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

Re: [DRAFT] Branching and merging with git

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 17, 2006, 09:37 UTC
Message-ID
<ejjvqr$k0v$1@sea.gmane.org>
In-Reply-To
<20061116221701.4499.qmail@science.horizon.com>
linux@horizon.com wrote:
> Either way, they're just a 41-byte file that contains a 40-byte hex
> object ID, plus a newline.  Tags are stored in .git/refs/tags, and heads
> are stored in .git/refs/heads.  Creating a new branch is literally just
> picking a file name and writing the ID of an existing commit into it.

This is an implementation detail, and is not true in repository with packed refs. Although usually (by default) only tags are packed.

But it remains true that ref (be it branch or tag) is just name and ID.
> The git programs enforce the immutability of tags, but that's a safety
> feature, not something fundamental.  You can rename a tag to the heads
> directory and go wild.

You can have only refs to commit objects in heads directory (and I hope this is verified by fsck-objects), you can have refs to tag objects (heavyweight tags), to commits (lightweight tags), to blobs (for example public PGP key used for signing tags), to trees (I guess unused).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: linux@horizon.comNext: Jakub Narebski
Message 2 of 37 in “[DRAFT] Branching and merging with git”
  1. linux@horizon.comNov 16, 2006
  2. Jakub NarebskiNov 17, 2006
  3. Jakub NarebskiNov 17, 2006
  4. Jakub NarebskiNov 17, 2006
  5. Theodore TsoNov 17, 2006
  6. SeanNov 17, 2006
  7. Nguyen Thai Ngoc DuyNov 17, 2006
  8. Marko MacekNov 17, 2006
  9. Petr BaudisNov 17, 2006
  10. SeanNov 17, 2006
  11. J. Bruce FieldsNov 17, 2006
  12. Jakub NarebskiNov 17, 2006
  13. Theodore TsoJan 3, 2007
  14. Junio C HamanoJan 3, 2007
  15. linux@horizon.comJan 4, 2007
  16. Junio C HamanoJan 4, 2007
  17. J. Bruce FieldsJan 7, 2007
  18. Junio C HamanoJan 8, 2007
  19. J. Bruce FieldsJan 8, 2007
  20. David KågedalJan 8, 2007
  21. Theodore TsoJan 8, 2007
  22. J. Bruce FieldsJan 9, 2007
  23. Andreas EricssonJan 9, 2007
  24. J. Bruce FieldsJan 9, 2007
  25. Theodore TsoJan 9, 2007
  26. J. Bruce FieldsJan 10, 2007
  27. Theodore TsoJan 8, 2007
  28. J. Bruce FieldsJan 8, 2007
  29. Jakub NarebskiJan 8, 2007
  30. Guilhem BonnefilleJan 8, 2007
  31. J. Bruce FieldsJan 9, 2007
  32. Petr BaudisNov 17, 2006
  33. SeanNov 17, 2006
  34. Petr BaudisNov 17, 2006
  35. Chris RiddochNov 17, 2006
  36. Petr BaudisNov 17, 2006
  37. SeanNov 17, 2006

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.