Draven
Draven

Reputation: 1467

Stop getting Git tags from specific remote repo

Question: Is it possible to not fetch tags by default by using git fetch Repo1 instead of having to use --no-tags?

Software:

Description: I have two repositories, Repo1 and Repo2. Both Repo's use tags to label versions (v0.0.1) but the versions are completely different from each other.

git fetch Repo1 automatically gets the tags from the repository but I need it to stop getting the tags from Repo1 because it's causing problems with Git Flow Hooks. I know I can use git fetch Repo1 --no-tags but I am using the Tower app instead of command line and it's set to fetch every 30 minutes.

Upvotes: 1

Views: 138

Answers (1)

Jeremy Fortune
Jeremy Fortune

Reputation: 2499

In your .gitconfig, specify remote.remote-name.tagopt. From the git-config man page:

   remote.<name>.tagopt
       Setting this value to --no-tags disables automatic tag following when fetching from remote <name>. Setting it to --tags will fetch every tag from remote <name>,
       even if they are not reachable from remote branch heads. Passing these flags directly to git-fetch(1) can override this setting. See options --tags and --no-tags of
       git-fetch(1).

Upvotes: 3

Related Questions