Skip to content

Commit 2fc85f0

Browse files
committed
Merge branch 'mg/push-repo-option-doc' into maint
The "git push" documentation made the "--repo=<there>" option easily misunderstood. * mg/push-repo-option-doc: git-push.txt: document the behavior of --repo
2 parents 8f3d03d + 57b92a7 commit 2fc85f0

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
@@ -214,22 +214,8 @@ origin +master` to force a push to the `master` branch). See the
214214
`<refspec>...` section above for details.
215215

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

234220
-u::
235221
--set-upstream::

0 commit comments

Comments
 (0)