How to delete an ORIG_HEAD branch in git?

余生颓废 提交于 2019-12-21 12:10:09

问题


Possible Duplicate:
git delete and recreate branch

To be honest I'm not sure ORIG_HEAD can be called a branch, yet it appears in my visual editor as one.

I have made a "git reset --hard HEAD~1" and then made some changes, finally committing them. How to get right of that ORIG_HEAD branch?


回答1:


See "HEAD and ORIG_HEAD in Git":

ORIG_HEAD is previous state of HEAD, set by commands that have possibly dangerous behavior, to be easy to revert them.
It is less useful now that Git has reflog: HEAD@{1} is roughly equivalent to ORIG_HEAD

In your case, you did a git reset, so Git left a "reminder" of where you were before said reset.
You can ignore it.

You can also get rid of it with a simple

rm -f $GIT_DIR/ORIG_HEAD
# or
rm -f .git/ORIG_HEAD

That is what the example/git-reset.sh script does for instance.



来源:https://stackoverflow.com/questions/12416814/how-to-delete-an-orig-head-branch-in-git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!