分离头指针:detached HEAD
意思就是正工作在一个没有分支的状态下,在没有对应任何分支的情况下,做了commit或者变更,如果在某天,切换到master分支做其他事情的时候,分离头指针的地方开发出来的变更没有对应的分支跟它挂钩,git就有可能会把它当做垃圾处理掉。所以想要做变更,请在某一个分支上做变更,对分支做变更,git才不会对他当垃圾处理掉。
commit 321da61f9dac1e4126e3ccff38ae2a231264e8cf
Author: crj
Date: Mon Dec 10 22:49:35 2018 +0800
Add readme.txt
Administrator@WIN-KF4CHDSKKH5 MINGW64 ~/Desktop/git-learning/git_learning (master)
$ git checkout 321da61f9dac1e
Note: checking out '321da61f9dac1e'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 321da61 Add readme.txt
Administrator@WIN-KF4CHDSKKH5 MINGW64 ~/Desktop/git-learning/git_learning ((321da61...))
$