I was on my own local feature branch and wanted to merge it into master. I checked out master, did git pull --rebase, had one conflict, resolved it, but I forgot to do git rebase --continue after that. Then I did git merge my_other_branch and then wanted to push that to origin, but git told me im not on any branch, so I was like "oh no, i fogot rebase --continue" so I did it then and git says "no changes - did you forget to use git add?". So right now I'm not on any branch...in some detached head state.
What do I need to do to get back on track?
git rebase --skip
Should continue the rebase.
Klas's answer is probably more useful, but in general a "detached head" means that where you're looking isn't a branch.
Thus, you can solve this by checking out a branch (specifically, the branch you wish you were on).
If something like this happens again, I would suggest looking at your current status with gitk --all, to get an idea about the repository structure and where you are.
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