Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HEAD detached from refs/heads/newBranch

Tags:

git

My Main Branch is master

Current Branch is decimalQuantity

After rebasing master branch to decimalQuantity branch Found conflicts, Resolved conflicts, but it's showing as HEAD detached from refs/heads/decimalQuantity and I have few files ready to commit.

What do you mean by this, how to solve this issue?

like image 632
Gagan Mesala Avatar asked Sep 06 '25 02:09

Gagan Mesala


1 Answers

To solve a detached HEAD, reattach it :

git checkout decimalQuantity

and in the case of modifications forbidding you to checkout with an error message, you can stash them (git stash), checkout as mentionned above, then reapply them (git stash pop).

like image 146
Romain Valeri Avatar answered Sep 07 '25 23:09

Romain Valeri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!