@matheusbsbs / matheus-bagliano / commits / bf07cc58ae
Fork 0

git-push.txt: Describe --repo option in more detail

The --repo option was described in a way that the reader would have to assume that it is the same as the <repository> parameter. But it actually servers a purpose, which is now written down. Furthermore, the --mirror option was missing from the synopsis. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Johannes Sixt committed Oct 7, 2008 at 16:26 UTC bf07cc58aeb84b1262cc58f571d2f7033474efa7
2 files changed +20 -6
Documentation/git-push.txt
+19 -5
@@ -9,8 +9,8 @@ git-push - Update remote refs along with associated objects
9 SYNOPSIS
10 --------
11 [verse]
12 -'git push' [--all] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>]
13 - [--repo=all] [-f | --force] [-v | --verbose]
12 +'git push' [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>]
13 + [--repo=<repository>] [-f | --force] [-v | --verbose]
14 [<repository> <refspec>...]
15
16 DESCRIPTION
@@ -101,9 +101,23 @@ nor in any Push line of the corresponding remotes file---see below).
101 This flag disables the check. This can cause the
102 remote repository to lose commits; use it with care.
103
104 ---repo=<repo>::
105 - When no repository is specified the command defaults to
106 - "origin"; this overrides it.
104 +--repo=<repository>::
105 + This option is only relevant if no <repository> argument is
106 + passed in the invocation. In this case, 'git-push' derives the
107 + remote name from the current branch: If it tracks a remote
108 + branch, then that remote repository is pushed to. Otherwise,
109 + the name "origin" is used. For this latter case, this option
110 + can be used to override the name "origin". In other words,
111 + the difference between these two commands
112 ++
113 +--------------------------
114 +git push public #1
115 +git push --repo=public #2
116 +--------------------------
117 ++
118 +is that #1 always pushes to "public" whereas #2 pushes to "public"
119 +only if the current branch does not track a remote branch. This is
120 +useful if you write an alias or script around 'git-push'.
121
122 --thin::
123 --no-thin::
builtin-push.c
+1 -1
@@ -10,7 +10,7 @@
10 #include "parse-options.h"
11
12 static const char * const push_usage[] = {
13 - "git push [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]",
13 + "git push [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]",
14 NULL,
15 };
16