2015-10-22 08:31:52 +01:00
|
|
|
# git push
|
2014-03-09 12:20:13 +00:00
|
|
|
|
2017-01-15 16:02:42 +00:00
|
|
|
> Push commits to a remote repository.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://git-scm.com/docs/git-push>.
|
2014-03-09 12:20:13 +00:00
|
|
|
|
2021-08-15 16:39:11 +01:00
|
|
|
- Send local changes in the current branch to its default remote counterpart:
|
2017-01-08 21:15:11 +00:00
|
|
|
|
|
|
|
`git push`
|
|
|
|
|
2021-08-15 16:39:11 +01:00
|
|
|
- Send changes from a specific local branch to its remote counterpart:
|
2014-03-09 12:20:13 +00:00
|
|
|
|
2016-09-21 16:35:46 +01:00
|
|
|
`git push {{remote_name}} {{local_branch}}`
|
2014-03-09 12:20:13 +00:00
|
|
|
|
2021-08-15 16:39:11 +01:00
|
|
|
- Send changes from a specific local branch to its remote counterpart, and set the remote one as the default push/pull target of the local one:
|
2017-01-08 21:15:11 +00:00
|
|
|
|
2021-08-15 16:39:11 +01:00
|
|
|
`git push -u {{remote_name}} {{local_branch}}`
|
|
|
|
|
|
|
|
- Send changes from a specific local branch to a specific remote branch:
|
|
|
|
|
|
|
|
`git push {{remote_name}} {{local_branch}}:{{remote_branch}}`
|
2017-01-08 21:15:11 +00:00
|
|
|
|
2017-01-08 21:20:14 +00:00
|
|
|
- Send changes on all local branches to their counterparts in a given remote repository:
|
2014-03-28 09:40:40 +00:00
|
|
|
|
2017-01-08 21:20:14 +00:00
|
|
|
`git push --all {{remote_name}}`
|
2014-03-28 09:40:40 +00:00
|
|
|
|
2017-01-08 21:15:11 +00:00
|
|
|
- Delete a branch in a remote repository:
|
2014-03-28 09:40:40 +00:00
|
|
|
|
2017-01-08 21:15:11 +00:00
|
|
|
`git push {{remote_name}} --delete {{remote_branch}}`
|
2014-03-28 09:40:40 +00:00
|
|
|
|
2017-01-08 21:20:14 +00:00
|
|
|
- Remove remote branches that don't have a local counterpart:
|
2014-03-09 12:20:13 +00:00
|
|
|
|
2016-09-21 16:35:46 +01:00
|
|
|
`git push --prune {{remote_name}}`
|
2015-12-18 02:04:11 +00:00
|
|
|
|
2017-01-08 21:15:11 +00:00
|
|
|
- Publish tags that aren't yet in the remote repository:
|
2015-12-18 02:04:11 +00:00
|
|
|
|
|
|
|
`git push --tags`
|