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