Skip to content

Commit 57b92a7

Browse files
Michael J Grubergitster
authored andcommitted
git-push.txt: document the behavior of --repo
As per the code, the --repo <repo> option is equivalent to the <repo> argument to 'git push', but somehow it was documented as something that is more than that. [It exists for historical reasons, back from the time when options had to come before arguments.] Say so. [But not that.] Signed-off-by: Michael J Gruber <[email protected]> Helped-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 282616c commit 57b92a7

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

Documentation/git-push.txt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -207,22 +207,8 @@ origin +master` to force a push to the `master` branch). See the
207207
`<refspec>...` section above for details.
208208

209209
--repo=<repository>::
210-
This option is only relevant if no <repository> argument is
211-
passed in the invocation. In this case, 'git push' derives the
212-
remote name from the current branch: If it tracks a remote
213-
branch, then that remote repository is pushed to. Otherwise,
214-
the name "origin" is used. For this latter case, this option
215-
can be used to override the name "origin". In other words,
216-
the difference between these two commands
217-
+
218-
--------------------------
219-
git push public #1
220-
git push --repo=public #2
221-
--------------------------
222-
+
223-
is that #1 always pushes to "public" whereas #2 pushes to "public"
224-
only if the current branch does not track a remote branch. This is
225-
useful if you write an alias or script around 'git push'.
210+
This option is equivalent to the <repository> argument. If both
211+
are specified, the command-line argument takes precedence.
226212

227213
-u::
228214
--set-upstream::

0 commit comments

Comments
 (0)