Fetch tags outside branches' histories
git help fetch says:
> By default, any tag that points into the histories being fetched is
> also fetched; the effect is to fetch tags that point at branches that
> you are interested in.
To give an example:
$ mkdir /tmp/source
$ cd /tmp/source
$ git init
$ touch /tmp/source/foo && git add foo && git commit -am foo
$ git clone /tmp/source /tmp/dest
$ git tag v1.0
$ git checkout -b temp
$ echo "Don't lose this" > foo && git commit -am "Important"
$ git tag dont-lose-this
$ git checkout master
$ git branch -D temp
$ cd /tmp/dest
$ git fetch
From /tmp/source
* [new tag] v1.0 -> v1.0
$ git fetch --tags
From /tmp/source
* [new tag] dont-lose-this -> dont-lose-this
It's important that we fetch all tags because we sometimes tag a branch
with 'archive/something' before force-pushing to it so we don't lose the
old head of that branch; it would be sad to not back those up.
Loading
Please register or sign in to comment