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

Re: git checkout -b origin/mybranch origin/mybranch

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 12, 2009, 18:31 UTC
Message-ID
<7vbps6lhjq.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<43d8ce650903120618h79686207vaa478c54f34e26f8@mail.gmail.com>
John Tapsell <johnflux@gmail.com> writes:
Show 6 quoted lines
> I'm saying that:
>
> git checkout -b origin/mybranch  origin/mybranch
>
> Is probably a mistake by the user.  We should warn the user and point
> them in the right direction.

Given Finn Arne Gangstad's use case in a nearby thread, I do not think you can so easily declare that it is a mistake by the user.

We have traditionally encouraged people to track remote origin/<name> with matching local <name>, but in a workflow that interact with multiple remotes, one obvious way to map would be to track remote origin/<name> with local origin/<name> branch. You can say remotes/origin/<name> when you mean the remote tracking one, and say heads/origin/<name> when you mean the local one, in order to disambiguate in such a setting.

Previous: John Tapsell
Message 20 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.