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

后端 未结 17 1218
礼貌的吻别
礼貌的吻别 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:35

    Simply read

    Pro Git Book: 4.2 Git on the Server - Getting Git on a Server

    which boild down to

    $ git clone --bare my_project my_project.git
    Cloning into bare repository 'my_project.git'...
    done.
    

    Then put my_project.git to the server

    Which mainly is, what answer #42 tried to point out. Shurely one could reinvent the wheel ;-)

提交回复
热议问题