2015-10-22 09:31:52 +02:00
|
|
|
# git push
|
2014-03-09 13:20:13 +01:00
|
|
|
|
2017-01-08 22:15:11 +01:00
|
|
|
> Push commits to a remote (upstream) repository.
|
2014-03-09 13:20:13 +01:00
|
|
|
|
2017-01-08 22:15:11 +01: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 13:20:13 +01:00
|
|
|
|
2016-09-21 17:35:46 +02:00
|
|
|
`git push {{remote_name}} {{local_branch}}`
|
2014-03-09 13:20:13 +01:00
|
|
|
|
2017-01-08 22:15:11 +01:00
|
|
|
- Publish the current branch to a remote repository, setting the upstream branch name:
|
|
|
|
|
|
|
|
`git push {{remote_name}} -u {{remote_branch}}`
|
|
|
|
|
2017-01-08 22:20:14 +01:00
|
|
|
- Send changes on all local branches to their counterparts in a given remote repository:
|
2014-03-28 10:40:40 +01:00
|
|
|
|
2017-01-08 22:20:14 +01:00
|
|
|
`git push --all {{remote_name}}`
|
2014-03-28 10:40:40 +01:00
|
|
|
|
2017-01-08 22:15:11 +01:00
|
|
|
- Delete a branch in a remote repository:
|
2014-03-28 10:40:40 +01:00
|
|
|
|
2017-01-08 22:15:11 +01:00
|
|
|
`git push {{remote_name}} --delete {{remote_branch}}`
|
2014-03-28 10:40:40 +01:00
|
|
|
|
2017-01-08 22:20:14 +01:00
|
|
|
- Remove remote branches that don't have a local counterpart:
|
2014-03-09 13:20:13 +01:00
|
|
|
|
2016-09-21 17:35:46 +02:00
|
|
|
`git push --prune {{remote_name}}`
|
2015-12-18 03:04:11 +01:00
|
|
|
|
2017-01-08 22:15:11 +01:00
|
|
|
- Publish tags that aren't yet in the remote repository:
|
2015-12-18 03:04:11 +01:00
|
|
|
|
|
|
|
`git push --tags`
|