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

前端 未结 30 2206
半阙折子戏
半阙折子戏 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:43

    You can recreate your server repository and push from your local branch master to the server master.

    On your remote server:

    mkdir myrepo.git
    cd myrepo.git
    git init --bare
    

    OK, from your local branch:

    git push origin master:master
    

提交回复
热议问题