I am on a detached head and made some changes. I want to push up these changed to this detached head with Git. I do not want my changes to go onto the develop branch and cer
While all the answers here sort of answer the original question (how to push from a detached head without affecting other branches) all suggest creating a new branch.
Here's how to push to a new remote branch without creating a new local branch:
git checkout --detach # (or anything else that leaves you with a detached HEAD - guillotine anyone?)
[change stuff & commit]
git push origin HEAD:refs/heads/my-new-branch
Replace origin with the appropriate remote name (that you have write access to), and my-new-branch with whatever you want the new branch to be called.
Your commit(s) on HEAD will be pushed to a new branch named my-new-branch.