Push branch to remote
suggest changeUse to push commits made on your local branch to a remote repository.
The git push command takes two arguments:
- A remote name, for example,
origin - A branch name, for example,
master
For example:
git push <REMOTENAME> <BRANCHNAME>
As an example, you usually run git push origin master to push your local changes to your online repository.
Using -u (short for --set-upstream) will set up the tracking information during the push.
git push -u <REMOTENAME> <BRANCHNAME>
git push origin new-feature sends the local branch new-feature to a remote branch of the same name, creating it if needed. To use a different name on the remote, put the remote branch name after the local branch name, separated by ::
git push <REMOTENAME> <LOCALBRANCHNAME>:<REMOTEBRANCHNAME>
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents