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

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

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 13, 2009, 14:08 UTC
Message-ID
<49BA68D1.2070102@drmicha.warpmail.net>
In-Reply-To
<43d8ce650903120714g782b98e8t81340546547fe98d@mail.gmail.com>
John Tapsell venit, vidit, dixit 12.03.2009 15:14:
Show 15 quoted lines
> 2009/3/12 Sverre Rabbelier <srabbelier@gmail.com>:
>> Heya,
>>
>> On Thu, Mar 12, 2009 at 14:18, John Tapsell <johnflux@gmail.com> wrote:
>>> Is probably a mistake by the user.  We should warn the user and point
>>> them in the right direction.
>>
>> The point is that we _already_ warned the user (like Dscho pointed
>> out), and that(as you pointed out), it didn't work :P.
> 
> Just doing:
> 
> git branch -b origin/master origin/master
> 
> gives no error or warning at all.

...and it really should not. If you have a repo with lots of remotes and tracking branches, it makes a lot of sense to have a local branch reponame/branchname which tracks the remote branch reponame/branchname. Note that the first is refs/heads/reponame/branchname whereas the latter is refs/remotes/reponame/branchname. It gives warnings when it's ambiguous, yay.

Michael J Gruber
Previous: John TapsellNext: Pieter de Bie
Message 9 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.