Making a Git push from a detached head

前端 未结 6 940
时光说笑
时光说笑 2020-11-29 20:05

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

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 20:59

    Create a new branch for that commit and checkout to it: git checkout -b . Now you can push your changes to the new branch: git push origin

    In case you need to clean up your other branch from leftover commits be sure to run git reset --hard .

    Here is an article that explains how branching and detached head works.

提交回复
热议问题