When git is working it’s a dream however when I get outside the regular workflow it is easy to get lost.
I have two projects where I have the need to pull commits from an upstream github repo and then push to my own github repo. I kept finding myself with a detached head after pulling from the upstream repo. I could resolve any conflicts, commit my changes, and merge them back into HEAD but pulling from upstream would just result in a detached HEAD again. I went around and around with this issue until I was ready to cry uncle. I tried resolving this both through the command line and several Mac Gui git clients.
Fortunately this project contains my files in a couple of isolated directories. This let me copy those directories out of the repo and then delete the repo and start over with a fresh clone of the upstream repo and then add my files back in.
This shows me that I need to spend more time using git or stop trying to do oddball things with it.