简体   繁体   中英

git subtree fetch - unwanted remote tags

I am getting started with git subtree.

When fetching from a subtree remote, one thing I notice is that after a git fetch, I have all the tags from this remote. These tags could be something like v1.0.5 , and it is impossible to distinguish tags from different remotes.

This behavior is technically not surprising. But it is still undesirable.

One solution could be to omit the tags with git fetch -n .

I wonder if this is the recommended way to do things, or if there is something smarter that people do. The -n option is not mentioned in the tutorials I read so far.


Note: I am using git subtree as described here , the "manual" approach.

Note: An answer that simply confirms the git fetch -n can be perfectly valid and acceptable - ideally with a link or two.

I have the following 3 lines to work with subtree

git remote add <alias> <url>
git config --local --add remote.<alias>.fetch +refs/tags/*:refs/tags/<alias>/*
git config remote.<alias>.tagopt --no-tags

Everytime you call git fetch <alias> the tag information of that remote is stored in a subfolder. The command git ls-remote --tags <alias> eventually lists these tags.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM