I am trying to checkout a branch that I was checking out with success in the past, and I can't check it out anymore. Here are the different messages I am getting. The easy solution would be to reset my folder, do a git init
and git clone
, but I do not want to reset my git folder as I set up things like git hooks (post-checkout
, post-merge
, etc). How could I get this to work again without resetting everything?
fatal: A branch named 'stage' already exists.
git fatal: reference is not a tree
error: refs/heads/stage does not point to a valid object!
fatal: bad object stage
The way to solve this in a clean way is to delete your corrupted branch in .git/refs/heads/your_branch_name
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With