Skip to content

Commit 39470cf

Browse files
moygitster
authored andcommitted
git-checkout.txt: clarify that <branch> applies when no path is given.
Otherwise, the sentence "Defaults to HEAD." can be mis-read to mean that "git checkout -- hello.c" checks-out from HEAD. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ce8936c commit 39470cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Documentation/git-checkout.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ should result in deletion of the path).
8585
<new_branch>::
8686
Name for the new branch.
8787

88+
<tree-ish>::
89+
Tree to checkout from (when paths are given). If not specified,
90+
the index will be used.
91+
8892
<branch>::
89-
Branch to checkout; may be any object ID that resolves to a
90-
commit. Defaults to HEAD.
93+
Branch to checkout (when no paths are given); may be any object
94+
ID that resolves to a commit. Defaults to HEAD.
9195
+
9296
When this parameter names a non-branch (but still a valid commit object),
9397
your HEAD becomes 'detached'.

0 commit comments

Comments
 (0)