From 6ddba5e241ebe484d53e3573c72386f487e25697 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Thu, 23 Feb 2012 00:43:41 +0200 Subject: push: add '--prune' option 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 Signed-off-by: Junio C Hamano --- builtin/push.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin') diff --git a/builtin/push.c b/builtin/push.c index 35cce532f2..fdfb2c4512 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -261,6 +261,8 @@ int cmd_push(int argc, const char **argv, const char *prefix) OPT_BIT('u', "set-upstream", &flags, "set upstream for git pull/status", TRANSPORT_PUSH_SET_UPSTREAM), OPT_BOOLEAN(0, "progress", &progress, "force progress reporting"), + OPT_BIT(0, "prune", &flags, "prune locally removed refs", + TRANSPORT_PUSH_PRUNE), OPT_END() }; -- cgit v1.2.1