Use to push commits made on your local branch to a remote repository.
git push command takes two arguments:
git push <REMOTENAME> <BRANCHNAME>
As an example, you usually run
git push origin master to push your local changes to your online repository.
-u (short for
--set-upstream) will set up the tracking information during the push.
git push -u <REMOTENAME> <BRANCHNAME>
git pushes the local branch to a remote branch with the same name. For example, if you have a local called
new-feature, if you push the local branch it will create a remote branch
new-feature as well. If you want to use a different name for the remote branch, append the remote name after the local branch name, separated by
git push <REMOTENAME> <LOCALBRANCHNAME>:<REMOTEBRANCHNAME>