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

git branch --track and remote branches with / in the name

From
Gerrit Pape <pape@smarden.org>
Date
Jun 5, 2007, 09:04 UTC
Message-ID
<20070605090404.24707.qmail@b58755fd627261.315fe32.mid.smarden.org>

Hi, the --track option to git branch or git checkout doesn't work for remote branches that contain a slash in the name:

 $ tail -n6 .git/config
 [remote "origin"]
         url = /tmp/repo
         fetch = +refs/heads/*:refs/remotes/origin/*
 [branch "master"]
         remote = origin
         merge = refs/heads/master
 $ git branch -r
   origin/HEAD
   origin/b
   origin/foo/b
   origin/master
 $ git branch --track b origin/b    
 Branch b set up to track remote branch refs/remotes/origin/b.
 $ git branch --track foo/b origin/foo/b
 $ tail -n6 .git/config
 [branch "master"]
         remote = origin
         merge = refs/heads/master
 [branch "b"]
         remote = origin
         merge = refs/heads/b
 $ 
Regards, Gerrit. 
Next: Junio C Hamano
Message 1 of 3 in “git branch --track and remote branches with / in the name”
  1. Gerrit PapeJun 5, 2007
  2. Junio C HamanoJun 5, 2007
  3. Gerrit PapeJun 5, 2007

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.