2015-06-28 41 views
1

問題:是否有可能不使用git fetch Repo1而不是使用--no-tags來默認取回標籤?停止從特定的遠程回購獲取Git標籤

軟件:

說明:我有兩個倉庫,Repo1和Repo2。這兩個版本都使用標籤來標籤版本(v0.0.1),但版本完全不同。

git fetch Repo1自動從存儲庫獲取標籤,但我需要它停止從Repo1獲取標籤,因爲它會導致Git Flow Hooks出現問題。我知道我可以使用git fetch Repo1 --no-tags,但我使用Tower應用程序而不是命令行,並且它設置爲每30分鐘獲取一次。

回答

3

在您的.gitconfig中,指定remote.remote-name.tagopt。從git-config手冊頁:

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). 
+0

完美!謝謝! – Draven