git detached HEAD explained
Git has something called a 'detached HEAD' that bears some explanation. Youare told 'do not commit on a detached HEAD', and it is not always clear whator why this is.开始主要讲git的原理,讲HEAD指针。反正,最重要的东
·
Git has something called a 'detached HEAD' that bears some explanation. Youare told 'do not commit on a detached HEAD', and it is not always clear whator why this is.
开始主要讲git的原理,讲HEAD指针。反正,最重要的东西在最后:
git reflog show HEAD@{now} -10
dcd215b... HEAD@{5 minutes ago}: commit (amend): 0-terminology: the malloc analogy added, plus
5ce8bfe... HEAD@{11 minutes ago}: commit: 0-terminology: the malloc analogy added, plus
3d93420... HEAD@{11 minutes ago}: rebase -i (pick): updating HEAD
7fdae94... HEAD@{11 minutes ago}: checkout: moving from master to 7fdae94815d6c676742c9984132b7b9e71a57f98
3d93420... HEAD@{13 minutes ago}: rebase -i (squash): updating HEAD
c55900c... HEAD@{13 minutes ago}: rebase -i (pick): updating HEAD
7fdae94... HEAD@{13 minutes ago}: checkout: moving from master to 7fdae94815d6c676742c9984132b7b9e71a57f98
e9955c8... HEAD@{14 minutes ago}: commit: s
97ab644... HEAD@{20 minutes ago}: commit: autogen
c55900c... HEAD@{23 minutes ago}: commit (amend): 0-terminology: the malloc analogy added, plus
Now you look at this, decide which one you want, and grab it:
git branch thank_God_its_safe 7fdae94
# like 'thank_God_its_safe = 0x7fdae94815d6c676742c9984132b7b9e71a57f98'
git checkout thank_God_its_safe
from:http://blog.csdn.net/raining_heart/article/details/8569904
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献3条内容
所有评论(0)