tldr/pages/common/git-push.md

33 lines
836 B
Markdown
Raw Normal View History

2015-10-22 08:31:52 +01:00
# git push
2014-03-09 12:20:13 +00:00
> Push commits to a remote repository.
> More information: <https://git-scm.com/docs/git-push>.
2014-03-09 12:20:13 +00:00
- Send local changes in the current branch to its remote counterpart:
`git push`
- Send local changes in a given branch to its remote counterpart:
2014-03-09 12:20:13 +00:00
`git push {{remote_name}} {{local_branch}}`
2014-03-09 12:20:13 +00:00
- Publish the current branch to a remote repository, setting the remote branch name:
`git push {{remote_name}} -u {{remote_branch}}`
- Send changes on all local branches to their counterparts in a given remote repository:
2014-03-28 09:40:40 +00:00
`git push --all {{remote_name}}`
2014-03-28 09:40:40 +00:00
- Delete a branch in a remote repository:
2014-03-28 09:40:40 +00:00
`git push {{remote_name}} --delete {{remote_branch}}`
2014-03-28 09:40:40 +00:00
- Remove remote branches that don't have a local counterpart:
2014-03-09 12:20:13 +00:00
`git push --prune {{remote_name}}`
- Publish tags that aren't yet in the remote repository:
`git push --tags`