【发布时间】:2017-07-28 13:03:13
【问题描述】:
在最近的 20-30 次提交中,我一直处于分离状态:
> git status
HEAD detached from ac83503
nothing to commit, working tree clean
我最初并没有注意到我处于这种状态。现在我希望这个超然的头成为我的主要分支,所以我give it a name
> git branch the-good-one
最后一条命令没有提供任何反馈,但现在看来一切正常:git log | head -1 显示:
fc876a2 Tue Mar 7 23:10:14 2017 (HEAD, the-good-one) This is the commit message.
然而git status 仍然回复:
HEAD detached from ac83503
nothing to commit, working tree clean
分配 git 分支名称是否不足以撤消分离的头部状态?
【问题讨论】:
-
git symbolic-ref HEAD refs/heads/the-good-one
标签: git