Here are some git actions I performed. As you can see, I made a new branch, modified my files, and then committed the changes. After changing back to another branch, hoping
for some reason, you're getting a detach head situation. I'm not entirely sure how that is caused in a regular git repo, but i've encountered it using git svn
(and came up with my own solution here). It might be that the aren't --track
ing the upstream repo when you create a new branch. Usually when you get a detached head
, when you do a git branch
, you will see (asterisk) (no branch)
(don't know how to do a literal asterisk with markdown)
Well I don't exactly see why the branch 'disappeared' but don't worry, your files didn't.
You can find them by many means:
git checkout
when you left your anonymous branch: "Previous HEAD position was 858491f".git reflog
and find the commit of your files.Then you can run this to recreate the branch:
git checkout 858491f -b fixed_merge_conflict
and then you can do your merge:
git checkout develop
git merge fixed_merge_conflict
Or you can do the merge in one step if you don't care about the branch:
git merge 858491f