Skip to content

Commit 8039184

Browse files
Anders Melchiorsengitster
authored andcommitted
Documentation: rework src/dst description in git push
This tries to make the description of ref matching in git push easier to read. Beauty is in the eye of the beholder, though. Signed-off-by: Anders Melchiorsen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1750783 commit 8039184

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Documentation/git-push.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,21 @@ OPTIONS
3939
It is used to specify with what <src> object the <dst> ref
4040
in the remote repository is to be updated.
4141
+
42-
The <src> side represents the source branch (or arbitrary
43-
"SHA1 expression", such as `master~4` (four parents before the
44-
tip of `master` branch); see linkgit:git-rev-parse[1]) that you
45-
want to push. The <dst> side represents the destination location.
42+
The <src> is often the name of the branch you would want to push, but
43+
it can be any arbitrary "SHA-1 expression", such as `master~4` or
44+
`HEAD` (see linkgit:git-rev-parse[1]).
4645
+
47-
The local ref that matches <src> is used
48-
to fast forward the remote ref that matches <dst>. If
49-
the optional leading plus `+` is used, the remote ref is updated
50-
even if it does not result in a fast forward update.
46+
The <dst> tells which ref on the remote side is updated with this
47+
push. Arbitrary expressions cannot be used here, an actual ref must
48+
be named. If `:`<dst> is omitted, the same ref as <src> will be
49+
updated.
5150
+
52-
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
51+
The object referenced by <src> is used to fast forward the ref <dst>
52+
on the remote side. If the optional leading plus `{plus}` is used, the
53+
remote ref is updated even if it does not result in a fast forward
54+
update.
5355
+
54-
A lonely <src> parameter (without a colon and a destination) pushes
55-
the <src> to the same name in the destination repository.
56+
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
5657
+
5758
Pushing an empty <src> allows you to delete the <dst> ref from
5859
the remote repository.

0 commit comments

Comments
 (0)