Fetch a single tag from remote repository

前端 未结 3 1258
醉话见心
醉话见心 2020-12-24 05:29

This command fetches all tags:

git fetch origin --tags

This command fetches a specific tag:

git fetch orig         


        
3条回答
  •  无人及你
    2020-12-24 06:00

    When you specify explicit refs to git fetch, you need to either provide a mapping in your refspec or do what you want with the fetched id's recorded in FETCH_HEAD yourself.

    The advantage to having the no-mapping-provided case do no default processing on the fetched refs is, the no-mapping-provided case does no default processing on the fetched refs. You might appreciate

    git fetch origin v2.3.18
    git tag v2.3.18 FETCH_HEAD    # ← git tag !$ FE
    

    when you really only want just the one tag set up in your local repo and not however many dozens of prior tags in the origin repo point into the fetched history.

提交回复
热议问题