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
Note: making a branch before pushing is all the more recommended that git 2.11 or less used to segfault!
This won't be the case with Git 2.12+ (Q1 2017)
See commit b10731f (07 Jan 2017) by Kyle Meyer (kyleam).
(Merged by Junio C Hamano -- gitster -- in commit b85f79c, 18 Jan 2017)
branch_get_push
: do not segfault when HEAD is detached"
git
" on a detached HEAD used to segfault; it has been corrected to error out with a message.@{push}
The error now will be:
HEAD does not point to a branch
With Git 2.12 or more, you can then push your detached HEAD to a remote branch, as shown in Matt's answer.