How to configure git to automatically receive tags every time I click?

This may or may not be a very stupid idea, but how can you configure the git repository so that any click that is performed automatically also extracts tags from another repository?

According to the docs , it looks like you can do this based on the remote repository:

remote <. & Name GT; .tagopt
Setting this value to -no-tags disables the automatic tag that follows after retrieving from the remote <name>. Setting to -tags will retrieve each tag from the remote <name>, even if they are inaccessible from remote branches. Passing these flags directly to git -fetch (1) may override this option. See Options --tags and --no tags git -fetch (1).

Is there a way to make the --tags default flag for the selection for each selection?

+8
git
source share
2 answers

Capturing tags have a different effect than committing ( git fetch ), as described in Does "git fetch --tags" include "git fetch"? "

The latter will update branch headers and will retrieve tags available from these updated branches.
The first will retrieve all tags, but will not update branch heads.

That way, if your tags can be retrieved from your selected branches, you do not need to include --tags by default.

Given the long history of some repositories (including linux one ), always wanting to get all the tags can clutter the list of tags (the list of tags contaminated with hundreds of unnecessary tags).


Note that running git 1.9 / 2.0 (Q1 2014), git fetch --tags will extract everything (e.g. git fetch ) plus tags. See " Does git fetch --tags git fetch ? "

Request that all tags be retrieved from the remote in addition to what has not yet been selected .

So you can try remote.<name>.tagOpt configuration option :

 git config (--global) remote.<name>.tagOpt --tags 

By setting it to --tags , you will get all tags from the remote <name> , even if they are inaccessible from the remote branches.

+5
source share

Just add this to your remote configuration:

 fetch = +refs/tags/*:refs/tags/* 
+4
source share

All Articles