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

git switch has fatal dependency on default fetch config

From
JJJeremiah Steele (Jerry) <jeremiah@dubsado.com>
Date
Dec 6, 2023, 03:41 UTC
Message-ID
<634F40AF-25F8-4FE6-BDE3-08798E699A9E@dubsado.com>
Changing the default fetch refspec for a remote breaks git switch:
% git branch -r
  origin/HEAD -> origin/master
  origin/feature
  origin/master
% git remote set-branches origin master
% git switch -c feature --track origin/feature
fatal: cannot set up tracking information; starting point 'origin/feature' is not a branch
% git remote set-branches --add origin feature
% git switch -c feature --track origin/feature
branch 'feature' set up to track 'origin/feature'.
Switched to a new branch 'feature'
It seems like I should be able to fetch a remote branch and track it without having to monkey around with my default fetch config. Is there a reason git switch has a hard dependency on the default remote fetch refspec configuration?
Next: Jeff King
Message 1 of 3 in “git switch has fatal dependency on default fetch config”
  1. Jeremiah Steele (Jerry)Dec 6, 2023
  2. Jeff KingDec 6, 2023
  3. Jeremiah Steele (Jerry)Dec 7, 2023

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.