How do I update my bare repo?

后端 未结 7 801
滥情空心
滥情空心 2020-11-29 16:14

I created a bare repo to publish my repository, but I can\'t figure out how to update the bare repo with the current state of the main repository.

7条回答
  •  孤城傲影
    2020-11-29 16:47

    I created a repository using the following command

    git clone --bare

    Then I tried to update the bare clone using the answer by Thomas, but it didn't work for me. To get the bare repository to update (which is what I think Let_Me_Be was asking), I had to create a mirror repository:

    git clone --mirror 
    

    Then I could run the following command in the mirrored repository to grab the main repository's updates:

    git fetch --all
    

    I came across this solution by reading Mirror a Git Repository By Pulling

提交回复
热议问题