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

Re: 'git branch' when origin branch with same name exists

From
Angus Hammond <angusgh@gmail.com>
Date
Jun 19, 2012, 15:57 UTC
Message-ID
<CAOBOgRab+KSMA_ZsE8z043gm15OkXzuf2a0dF=LeyR+oJvC5mg@mail.gmail.com>
In-Reply-To
<4FE09C39.50702@elegosoft.com>
> This very much violates the distributed nature of Git. Everything
> is allowed, because it's *my* repository.

By the sounds of it everything still would be allowed for a user who knew that they wanted to create a branch even if it did have a conflicting name. However (that I can think of) this is not something you usually want to do, so it's reasonable to assume that when this happens it's usually user error, so git should tell the user what it thinks they meant to do and also give them the option to carry on anyway (probably with a -f flag).

This is (I think) exactly what git already does with local branches.

Thanks Angus

Previous: Philippe VaucherNext: Konstantin Khomoutov
Message 6 of 19 in “'git branch' when origin branch with same name exists”
  1. Ryan LortieJun 19, 2012
  2. jaseem abidJun 19, 2012
  3. Michael SchubertJun 19, 2012
  4. Ryan LortieJun 19, 2012
  5. Philippe VaucherJun 19, 2012
  6. Angus HammondJun 19, 2012
  7. Konstantin KhomoutovJun 19, 2012
  8. Ryan LortieJun 19, 2012
  9. Andreas EricssonJun 20, 2012
  10. Thomas RastJun 19, 2012
  11. Junio C HamanoJun 19, 2012
  12. Ryan LortieJun 19, 2012
  13. Junio C HamanoJun 19, 2012
  14. Ryan LortieJun 19, 2012
  15. Phil HordJun 19, 2012
  16. Junio C HamanoJun 20, 2012
  17. Matthieu MoyJun 20, 2012
  18. Junio C HamanoJun 20, 2012
  19. Junio C HamanoJun 19, 2012

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.