git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git fetch overwriting local tags

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Nov 23, 2011, 09:08 UTC
Message-ID
<20111123090821.GL19986@pengutronix.de>
Hello,

John and I wondered about git fetch overwriting local tags. I was sure enough to claim that git fetch won't overwrite local tags with remote tags having the same name. But after John pointed me to

	http://www.pythian.com/news/9067/on-the-perils-of-importing-remote-tags-in-git/

I tested that (using Debian's 1.7.7.3) and really, git does overwrite local tags.

Here is my test script:
	mkdir a
	cd a
	echo some content > some_file
	git init 
	git add some_file
	git commit -m 'some commit log'
	git tag some_tag
	cd ..
	mkdir b
	cd b
	echo some different content > another_file
	git init 
	git add another_file
	git commit -m 'another commit log'
	git tag some_tag
	git fetch --tags ../a
After that I have:
	git log -1 --oneline some_tag
	c4ad89a some commit log
so b's tag was overwritten.
Is this intended?

Best regards Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Next: Jeff King
Message 1 of 3 in “git fetch overwriting local tags”
  1. Uwe Kleine-KönigNov 23, 2011
  2. Jeff KingNov 23, 2011
  3. Uwe Kleine-KönigNov 24, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.