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

fetch <repo> <branch>:<branch> fetches tags?

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jan 29, 2008, 02:33 UTC
Message-ID
<479E9063.5000403@nrlssc.navy.mil>
Is this the intended behavior?

I'm pretty sure this was discussed recently on the list. My understanding was that tags would only be fetched automatically if a remote tracking branch was configured.

$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
I expect these to fetch tags automatically (and they do):
   git fetch
   git pull
   git fetch <repo>
   git pull <repo>
I expect these to _not_ fetch tags (and they don't):
   git fetch <repo> <branch>
   git pull <repo> <branch>
But, I did not expect these to fetch tags:
   git fetch <repo> <branch>:<branch>
   git pull <repo> <branch>:<branch>

The association I am making here is between manually specifying the repo and branch implying "don't automatically fetch tags", and fetch/pull automatically determining the branch (and repo) implying "automatically fetch tags".

There is nothing automatic about that last form of fetch.
I know there is --no-tags, and I know I can do
   git fetch <repo> <branch>
   git branch <branch> FETCH_HEAD

But neither are what I expected to have to do. So I guess the colon notation implies remote tracking? I'm not sure I want the tags by default when I call fetch this way. In this instance I definitely did not want them.

-brandon
Next: Johannes Schindelin
Message 1 of 9 in “fetch <repo> <branch>:<branch> fetches tags?”
  1. Brandon CaseyJan 29, 2008
  2. Johannes SchindelinJan 29, 2008
  3. Brandon CaseyJan 29, 2008
  4. Junio C HamanoJan 29, 2008
  5. Shawn O. PearceJan 29, 2008
  6. Junio C HamanoJan 29, 2008
  7. Brandon CaseyJan 29, 2008
  8. Junio C HamanoJan 29, 2008
  9. Brandon CaseyJan 29, 2008

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.