Git push error '[remote rejected] master -> master (branch is currently checked out)'

前端 未结 30 2204
半阙折子戏
半阙折子戏 2020-11-22 00:07

Yesterday, I posted a question on how to clone a Git repository from one of my machines to another, How can I \'git clone\' from another machine?.

I am now

30条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 00:34

    OK, in case you want a normal remote repository, then create an extra branch and check it out. Push it into one branch (which is not checked out) and merge it with one which is currently active later after pushing from locally.

    For example, on a remote server:

    git branch dev
    git checkout dev
    

    On the local setup:

    git push 
    

    On remote server:

    git merge dev
    

提交回复
热议问题