How do I update my bare repo?

后端 未结 7 805
滥情空心
滥情空心 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

    Assuming:

    $ git clone --bare https://github.com/.../foo.git
    

    Fetch with:

    $ git --git-dir=foo.git fetch origin +refs/heads/*:refs/heads/* --prune
    

    Note: --git-dir=foo.git is not required if you cd to the directory first.

提交回复
热议问题