Push commits made on your local branch to a remote repository.
git push
Pushes the specified branch to remote
with necessary commits creating a local branch in the destination repository.
git push [remote] [branch]
This pushes the LOCALBRANCHNAME
to your REMOTENAME
, but it is renamed to REMOTEBRANCHNAME
.
git push [REMOTENAME] [LOCALBRANCHNAME]:[REMOTEBRANCHNAME]
Forces the push even if it results in a non-fast-forward merge. Be sure that nobody has pulled the commits before using the --force option.
git push [remote] --force
Pushes all of the local branches to the remote repository.
git push [remote] --all
Pushes the spesific tags from the local branches to the remote repository.
git push [REMOTENAME] [TAGNAME]
Pushes all tags from the local branches to the remote repository.
git push [remote] --tags
Note that there is a space before the colon. The command resembles the same steps you'd take to rename a branch. However, here, you're telling Git to push nothing into BRANCHNAME on REMOTENAME. Because of this, git push deletes the branch on the remote repository.
git push [REMOTENAME] :[BRANCHNAME]