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

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

    You can simply convert your remote repository to bare repository (there is no working copy in the bare repository - the folder contains only the actual repository data).

    Execute the following command in your remote repository folder:

    git config --bool core.bare true
    

    Then delete all the files except .git in that folder. And then you will be able to perform git push to the remote repository without any errors.

提交回复
热议问题