Git: How do I pull a tagged revision into my fork?

后端 未结 2 654
滥情空心
滥情空心 2020-12-23 14:27

I have a fork of a project on github where the main trunk was recently tagged. I want to pull the code from the tagged revision into my fork. How would I do that?

2条回答
  •  自闭症患者
    2020-12-23 15:00

    Once you have the tag in local repository you can do something like

    git merge tags/yourtag

    If you don't have the "trunk" tags locally, you can fetch it using

    git fetch remote-url "refs/tags/*:refs/tags/*"

    Or by setting up the remote

    git remote add upstream remote-url

    and fetching the stuff using

    git fetch -t upstream

    I think, though, using

    git remote update

    will have similar effect.

提交回复
热议问题