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>
maint
Felipe Contreras13 years agocommitted byJunio C Hamano
@ -71,6 +71,14 @@ nor in any Push line of the corresponding remotes file---see below).
@@ -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
@ -145,7 +145,8 @@ int branch_merge_matches(struct branch *, int n, const char *);
@@ -145,7 +145,8 @@ int branch_merge_matches(struct branch *, int n, const char *);