diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2012-02-23 00:43:41 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-22 18:17:39 -0800 |
commit | 6ddba5e241ebe484d53e3573c72386f487e25697 (patch) | |
tree | 836c5b5f1ee5d900e87ea9d60c32e576e219b68f /Documentation/git-push.txt | |
parent | 676552464a871564835e1cb9d0484277b1b75e79 (diff) | |
download | git-6ddba5e241ebe484d53e3573c72386f487e25697.tar.gz |
push: add '--prune' optionfc/push-prune
When pushing groups of refs to a remote, there is no simple way to remove
old refs that still exist at the remote that is no longer updated from us.
This will allow us to remove such refs from the remote.
With this change, running this command
$ git push --prune remote refs/heads/*:refs/remotes/laptop/*
removes refs/remotes/laptop/foo from the remote if we do not have branch
"foo" locally anymore.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-push.txt')
-rw-r--r-- | Documentation/git-push.txt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index aede48877f..48760db337 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git push' [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=<git-receive-pack>] - [--repo=<repository>] [-f | --force] [-v | --verbose] [-u | --set-upstream] + [--repo=<repository>] [-f | --force] [--prune] [-v | --verbose] [-u | --set-upstream] [<repository> [<refspec>...]] DESCRIPTION @@ -71,6 +71,14 @@ nor in any Push line of the corresponding remotes file---see below). Instead of naming each ref to push, specifies that all refs under `refs/heads/` be pushed. +--prune:: + Remove remote branches that don't have a local counterpart. For example + a remote branch `tmp` will be removed if a local branch with the same + name doesn't exist any more. This also respects refspecs, e.g. + `git push --prune remote refs/heads/{asterisk}:refs/tmp/{asterisk}` would + make sure that remote `refs/tmp/foo` will be removed if `refs/heads/foo` + doesn't exist. + --mirror:: Instead of naming each ref to push, specifies that all refs under `refs/` (which includes but is not |