If git branch
shows that your current branch is original_idea, that wouldn’t be a detached HEAD situation.
But in any case, if you want your master to reflect your “current commit” (which is what HEAD means in Git):
git branch -f master HEAD
git checkout master
You would find other alternatives in “How to I “move” my commits from “no branch” to an actual branch?”.
The problem with this is that it makes the entire branch currently ending at master disappear.
Then all you need to do is:
- make sure HEAD is referenced by a branch (like
original_idea
on your schema) - rebase that branch on top of master:
That would mean:
git checkout original_idea
git rebase master
git checkout master
git merge original_idea