How to get rid of "refs / bisect / bad" branches in Git

I have the following in my ~/.gitconfig (this is only here to help you understand what I'm looking for):

 [alias] lg = log --graph --all --pretty=format:'%Cred%h %Cgreen(%cr)%Creset - %s %C(yellow)%d %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative 

When I do git log , it shows me a full commit tree with branch names, etc. Yesterday I initiated git bisect , and today I see that there is a branch refs/bisect/bad on the output of my log.

What is the refs/bisect/bad branch and how can I get rid of it?

+6
git git-bisect
source share
2 answers

When you use git bisect , it uses refs/bisect/bad to track the last bad commit. (This ref is updated when you do git bisect bad .)

I suspect that it happened here that you reached the end of the bisector and he reported the first bad commit, but you never finished halving with git bisect reset , which would clear the links that he created. You can still run this command and it will return you to where you were before starting the bisector - however, I would make sure that your work was completed and the git status was clean before doing this to avoid possible confusion.

If you use __git_ps1 in your bash prompt, it will be useful to note that you are still in half-split mode by (9dad0bb...)|BISECTING . I discussed __git_ps1 slightly different answer , which may be useful.

+10
source share

The pointer to commit is marked as bad during bisect. You can run

git bisect reset

or manually remove the pointer from .git / refs / bisect (but I do not recommend)

+11
source share

All Articles