Documentation: Moving out of detached HEAD does not warn anymore.
The documentation still talked about the unnecessary 'safety' in git-checkout. Pointed out by Matthias Lederhofer. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Feb 13, 2007 at 08:58 UTC
cec8d146fc020c3815d424ff6d94b3d3a1aaf1ff
1 file changed
+6
-16
Documentation/git-checkout.txt
+6
-16
@@ -103,22 +103,12 @@ by any branch (which is natural --- you are not on any branch).
103
What this means is that you can discard your temporary commits
104
and merges by switching back to an existing branch (e.g. `git
105
checkout master`), and a later `git prune` or `git gc` would
106
-garbage-collect them.
107
-
108
-The command would refuse to switch back to make sure that you do
109
-not discard your temporary state by mistake when your detached
110
-HEAD is not pointed at by any existing ref. If you did want to
111
-save your state (e.g. "I was interested in the fifth commit from
112
-the top of 'master' branch", or "I made two commits to fix minor
113
-bugs while on a detached HEAD" -- and if you do not want to lose
114
-these facts), you can create a new branch and switch to it with
115
-`git checkout -b newbranch` so that you can keep building on
116
-that state, or tag it first so that you can come back to it
117
-later and switch to the branch you wanted to switch to with `git
118
-tag that_state; git checkout master`. On the other hand, if you
119
-did want to discard the temporary state, you can give `-f`
120
-option (e.g. `git checkout -f master`) to override this
121
-behaviour.
106
+garbage-collect them. If you did this by mistake, you can ask
107
+the reflog for HEAD where you were, e.g.
108
+
109
+------------
110
+$ git log -g -2 HEAD
111
+------------
112
113
114
EXAMPLES