Getting a working copy of a bare repository

前端 未结 7 704
渐次进展
渐次进展 2020-12-08 09:35

I have a server on which I have a bare repository for pushing. However, my server needs to have a working copy of the master branch.

How do I get a working copy and

7条回答
  •  感情败类
    2020-12-08 10:03

    A bare repository is just the .git directory of a working directory, and an entry in the local config file. What I did to convert a bare repository into a full one is:

    • Create a new subdirectory .git and move all files from the bare repository in there
    • Edit the .git/config file to change bare = true to bare = false
    • Check out the branch you want. This extracts all files from the repository into the working directory.

    You could set the Hidden attribute on the .git directory on Windows, but not on the files inside the directory.

提交回复
热议问题