git-push: allow -f as an alias for --force
This was already documented in the options section of the manpage. This patch implements it, adds it to the usage message, and mentions it at the top of the manpage. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jeff King committed
Aug 2, 2006 at 11:28 UTC
8f615493e6b6fd47bc4011c264cb7e6f01052d37
2 files changed
+3
-3
Documentation/git-push.txt
+1
-1
@@ -8,7 +8,7 @@ git-push - Update remote refs along with associated objects
8
9
SYNOPSIS
10
--------
11
-'git-push' [--all] [--tags] [--force] <repository> <refspec>...
11
+'git-push' [--all] [--tags] [-f | --force] <repository> <refspec>...
12
13
DESCRIPTION
14
-----------
builtin-push.c
+2
-2
@@ -8,7 +8,7 @@
8
9
#define MAX_URI (16)
10
11
-static const char push_usage[] = "git push [--all] [--tags] [--force] <repository> [<refspec>...]";
11
+static const char push_usage[] = "git push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
12
13
static int all = 0, tags = 0, force = 0, thin = 1;
14
static const char *execute = NULL;
@@ -291,7 +291,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
291
tags = 1;
292
continue;
293
}
294
- if (!strcmp(arg, "--force")) {
294
+ if (!strcmp(arg, "--force") || !strcmp(arg, "-f")) {
295
force = 1;
296
continue;
297
}