Making a Git push from a detached head

前端 未结 6 942
时光说笑
时光说笑 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:39

    If you are on a detached head and you want to push to your remote branch

    git push origin HEAD:name-of-your-branch
    

    otherwise you can create a new branch and push to it ( it will be created automatically )

    git branch new-branch-name
    git push -u origin new-branch-name
    

提交回复
热议问题