3 ms·
No, branches are not git objects. An object is something that is identified by its sha1. Branches are merely files on the filesystem that point to objects.
by rakoo 9y ago
No, branches are not git objects. An object is something that is identified by its sha1. Branches are merely files on the filesystem that point to objects.
- hasenj 9y agoYou're thinking about branch names. The branch itself (anonymous branch?) is part of git because the commit history is a tree with branches.
- rakoo 9y agoIt's part of git, but is not a git object, those have a very specific definition: it's all the thing that are identified by their hash. Note that the commit history doesn't depend on branches: it's just a chain from commit to commits. The tree can exist withou any branch at all. That wouldn't be very useful, but it's still valid. Branches are merely pointers to a commit.