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

Re: git-svn tags and branches

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 29, 2007, 08:59 UTC
Message-ID
<7v4piisolb.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<cb7bb73a0708290141y159d6bbfj2bac23af5e86bb15@mail.gmail.com>
"Giuseppe Bilotta" <giuseppe.bilotta@gmail.com> writes:
> BTW can git have a tag and a branch with the same name? If
> not,...
This is "Yes but".
You can have a tag foo and branch foo.
- "git checkout foo" would switch you to foo branch
- Anything else that lets you use an abbreviated refname 'foo',
  e.g.
  . git branch newbranch foo
  . git log foo
  . git diff foo
  will scold you that 'foo' is ambiguous, while it does not
  outright fail, and takes the first match from the list defined
  in sha1_name.c (ref_fmt[]), so a tag wins over a branch.  You
  can clarify yourself to avoid ambiguity like so:
  . git branch newbranch heads/foo ;# I mean "branch from foo branch"
  . git log tags/foo ;# "show history starting at that tag"
Previous: Andreas EricssonNext: Giuseppe Bilotta
Message 13 of 17 in “git-svn tags and branches”
  1. Giuseppe BilottaAug 27, 2007
  2. David KastrupAug 27, 2007
  3. Mike HommeyAug 27, 2007
  4. Benoit SIGOUREAug 27, 2007
  5. Giuseppe BilottaAug 27, 2007
  6. Giuseppe BilottaAug 27, 2007
  7. Eric WongAug 30, 2007
  8. Giuseppe BilottaAug 30, 2007
  9. Peter BaumannAug 30, 2007
  10. Giuseppe BilottaAug 30, 2007
  11. Giuseppe BilottaAug 29, 2007
  12. Andreas EricssonAug 29, 2007
  13. Junio C HamanoAug 29, 2007
  14. Giuseppe BilottaAug 29, 2007
  15. Junio C HamanoAug 29, 2007
  16. Giuseppe BilottaAug 29, 2007
  17. Giuseppe BilottaAug 29, 2007

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.