Attempting to start git bisect gives 'fatal: invalid reference:...'
Asked Answered
S

2

9

Attempting to start a bisect with the following command,

git bisect start

causes Git to respond:

fatal: invalid reference: atrium-3018

What is the cause of this and how can I fix it?

Schlieren answered 3/1, 2015 at 0:1 Comment(0)
S
15

Apparent this is due to relics of a pevious bisect, that you can resolve with a simple:

rm .git/BISECT_*

(Thanks to Christian for the tip)

Edit - I haven't tested this - but it seems from the doco the more correct response maybe

git bisect reset

If anyone else hit this they may want to try the proper approach and report the outcome)

Schlieren answered 3/1, 2015 at 0:1 Comment(1)
I've just had the same issue when trying to cancel an old bisect using the git bisect reset command you mentioned. Your suggestion about removing the temporary files fixed it for me :)Ambidexter
G
0

For me, I got this error because of a months-old git bisect session. The branch which it had started had long been deleted.

My solution was to do

git bisect reset <branch name>

where <branch name> was a branch that actually exists in my local repo.

Alternatively, I imagine you can just create a new branch with the same name as the one git bisect reset is complaining about.

Greenshank answered 3/10, 2022 at 19:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.