search

Home  >  Q&A  >  body text

How to use git to turn an existing directory into a warehouse

There is a folder A on the server side with many files in it. I want to turn it into a warehouse (that is, it contains a .git), but I entered git --bare init in the B.git folder. How can I use A as a warehouse? B's warehouse? ?

给我你的怀抱给我你的怀抱2771 days ago729

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-02 09:51:13

    First move out all the files in the A folder, initialize it into a warehouse and then move it in

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-02 09:51:13

    1. The B.git folder has been init

      > 只需要将.git文件夹删除就行了比如 rm -rf .git
    2. I want the A folder on the server side to be used as a warehouse

      > 这个比较困难,因为普通的服务器要支持git的操作还需要安装git server端的一些东西比较麻烦
      
      [有兴趣可以看这里](http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137583770360579bc4b458f044ce7afed3df579123eca000)
    3. A serves as B’s warehouse

      > 楼主不如这样做会更简单,把代码托管到第三方平台,coding,github,gitlab,然后server端和自己文件夹都使用git clone去clone第三方平台的代码
      

      References

    reply
    0
  • Cancelreply