Create a new branch:
git checkout -b feature_branch_name
Edit, add and commit your files.
Push your branch to the remote repository:
git push -u origin feature_branch_name
#Just follow next steps in console terminal ;)
git init #Initialize git in folder
git add . #add all files of folder to be pushed
git commit -m "First commit" #add first commit
git remote add origin remote_repository_URL #replace with your remote repo url
git remote -v #verify that your remote repository url is properly found
git push --force origin master #force pushing your project into github repo
git push origin HEAD
A handy way to push the current branch to the same name on the remote.
# To set upstream tracking information in the local branch,
# if you haven't already pushed to the origin.
git push -u origin HEAD
How do I push a new local branch to a remote Git repository and track it too?
Prior to the introduction of git push -u, there was no git push option to obtain what you desire. You had to add new configuration statements.
If you create a new branch using:
$ git checkout -b branchB
$ git push origin branchB:branchB
You can use the git config command to avoid editing directly the .git/config file:
$ git config branch.branchB.remote origin
$ git config branch.branchB.merge refs/heads/branchB
Or you can edit manually the .git/config file to add tracking information to this branch:
[branch "branchB"]
remote = origin
merge = refs/heads/branchB