3 ms·
If you are talking about the thing that git calls a branch, it's literally just a pointer to a commit. You can look it up manually. Here is a random repo I have
by elsjaako 4y ago
If you are talking about the thing that git calls a branch, it's literally just a pointer to a commit. You can look it up manually. Here is a random repo I have on my PC:
~/p/s/sigrok-cli> cat .git/refs/heads/master
7bdc46d6fcdcfa00dd29ac102f3128aeb44a479c
In principle all these objects are in the .git/objects folder. But the encoding is some binary thing for branches, and anyway it's often stored differently (I assume for space saving reasons). But git can explain what every object is.
~/p/s/sigrok-cli> git cat-file -p 7bdc46d6fcdcfa00dd29ac102f3128aeb44a479c
tree fa02da4030e5791695b8a7a5400ee2c2cc88ee46
parent 09fc39da486b8618d65b66ca96a760478c3e89e2
author Uwe Hermann <...> 1454100673 +0100
committer Uwe Hermann <...> 1454100673 +0100
NEWS: Update for upcoming 0.6.0 release.
~/p/s/sigrok-cli> git cat-file -p fa02da4030e5791695b8a7a5400ee2c2cc88ee46
100644 blob d1d8ffca429d2a4697a56fd7dedbeee3fc6d577d .gitignore
100644 blob 28c1b20e6d7d146fbc6ad0270ff5b09cfd057b26 AUTHORS
100644 blob 94a9ed024d3859793618152ea559a168bbcbb5e2 COPYING
100644 blob 04c29abe3dc42c8ecb8ec1b71093437d8c382ebd HACKING
100644 blob c6d6c8a7cff1a5b7d940e0c040ad1d4f5337f646 Makefile.am
... etc
The git software just updates the branch to create the illusion that it's not just a pointer to a commit. But really, it's literally a file with the sha1 hash of the commit.