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

git checkout -b origin/mybranch origin/mybranch

From
John Tapsell <johnflux@gmail.com>
Date
Mar 12, 2009, 11:36 UTC
Message-ID
<43d8ce650903120436u261cb7e3p838e4a12e7b54d7d@mail.gmail.com>
Hey all,
  One of my collegues did:
git checkout origin/somebranch
  git complained that they need to specify the name with -b.  So they did:
git checkout -b origin/somebranch origin/somebranch
  Git accepts this with no problems, but boy - all hell broke loose.
Doing a push or pull gave errors, because "origin/somebranch" is now
ambigous (since there is two of them).  They can't even:  "git
checkout -b somebranch origin/somebranch"  anymore, since
"origin/somebranch" is ambigous.  It all got into a mess.
  I've sort it out now, but I'd like to request that git doesn't so
easily let the user shoot themselves in the foot.
  I propose that creating a branch called  "origin/*" or "remotes/*"
gives at _least_ a warning, and preferably an error (overrideable with
--force for people who really really want to do it)
John Tapsell
Next: Sverre Rabbelier
Message 1 of 20 in “git checkout -b origin/mybranch origin/mybranch”
  1. John TapsellMar 12, 2009
  2. Sverre RabbelierMar 12, 2009
  3. Johannes SchindelinMar 12, 2009
  4. John TapsellMar 12, 2009
  5. Johannes SchindelinMar 12, 2009
  6. John TapsellMar 12, 2009
  7. Sverre RabbelierMar 12, 2009
  8. John TapsellMar 12, 2009
  9. Michael J GruberMar 13, 2009
  10. Pieter de BieMar 12, 2009
  11. Jeff KingMar 12, 2009
  12. John TapsellMar 12, 2009
  13. Jeff KingMar 12, 2009
  14. Pieter de BieMar 12, 2009
  15. Jeff KingMar 12, 2009
  16. John TapsellMar 12, 2009
  17. Jeff KingMar 12, 2009
  18. John TapsellMar 12, 2009
  19. John TapsellMar 12, 2009
  20. Junio C HamanoMar 12, 2009

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.