In git, how do I sync my tags against a remote server?

前端 未结 8 803
天涯浪人
天涯浪人 2020-12-02 08:37

Is there a way to keep my local git tags in lockstep with a remote\'s tags? That is -- not only get new tags when created (as usual, when fetch-ing/pull

8条回答
  •  囚心锁ツ
    2020-12-02 09:21

    disclaimer this uses git internals (some may argue that the filesystem is a git interface, but that's for another day :D)

    # Blow away all local tags, this will remove any that are tagged locally
    # but are not on the remote
    rm .git/refs/tags/*
    
    # Download all the tags from the remote
    git fetch --tags
    

提交回复
热议问题