Skip to content

Commit a158904

Browse files
committed
Merge branch 'mg/push-repo-option-doc'
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 445bb5b + 57b92a7 commit a158904

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

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

239225
-u::
240226
--set-upstream::

0 commit comments

Comments
 (0)