From ce8936c342a15a08029c71fdc92e283e3624bc18 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Mon, 6 Apr 2009 22:45:21 +0200 Subject: git-checkout.txt: fix incorrect statement about HEAD and index The command "git checkout" checks out from the index by default, not HEAD (the introducing comment were correct, but the detailled explanation added below were not). Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- Documentation/git-checkout.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation/git-checkout.txt') diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 5aa69c0e1..883047982 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -145,8 +145,8 @@ $ git checkout hello.c <3> ------------ + <1> switch branch -<2> take out a file out of other commit -<3> restore hello.c from HEAD of current branch +<2> take a file out of another commit +<3> restore hello.c from the index + If you have an unfortunate branch that is named `hello.c`, this step would be confused as an instruction to switch to that branch. -- cgit v1.2.1 From 39470cf961e584ddb505f51bb9c452ebcfd5c569 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Tue, 7 Apr 2009 14:43:53 +0200 Subject: git-checkout.txt: clarify that 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 Signed-off-by: Junio C Hamano --- Documentation/git-checkout.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Documentation/git-checkout.txt') diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 883047982..19510de15 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -85,9 +85,13 @@ should result in deletion of the path). :: Name for the new branch. +:: + Tree to checkout from (when paths are given). If not specified, + the index will be used. + :: - Branch to checkout; may be any object ID that resolves to a - commit. Defaults to HEAD. + Branch to checkout (when no paths are given); may be any object + ID that resolves to a commit. Defaults to HEAD. + When this parameter names a non-branch (but still a valid commit object), your HEAD becomes 'detached'. -- cgit v1.2.1