How to convert a normal Git repository to a bare one?

后端 未结 17 1290
礼貌的吻别
礼貌的吻别 2020-11-22 08:05

How can I convert a \'normal\' Git repository to a bare one?

The main difference seems to be:

  • in the normal Git repository, you have a .git

17条回答
  •  我寻月下人不归
    2020-11-22 08:14

    i've read the answers and i have done this:

    cd repos
    mv .git repos.git
    cd repos.git
    git config --bool core.bare true # from another answer
    cd ../
    mv repos.git ../
    cd ../
    rm -rf repos/ # or delete using a file manager if you like
    

    this will leave the contents of repos/.git as the bare repos.git

提交回复
热议问题