开发者

Git: how to remove root commit

开发者_Go百科

I have following situation in my local Git repository:

master: A---B---C <-HEAD

(no name): D

so there is special commit "D" on separate branch, not relating on any other branch. I want to delete the "(no name)" branch. When trying to revert "D", I get: "Cannot revert a root commit".

Thank you for help.


If there is no branch that reference D, then git will remove the reference when you do a garbage collection.


What Casey said. Run "git gc" and see if it still exists. The other thing you might want to try is create a new branch at D and then remove the branch with git -D

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜