跟踪 Git 分支中的提交
为了了解 Git 分支,我遇到了以下内容, 从此页面引用 - 向底部,
由于 Git 中的分支实际上是一个简单文件,其中包含它所指向的提交的 40 个字符 SHA-1 校验和,因此创建和销毁分支的成本都很低。
在我的一个项目的 Git 存储库中,当我打开此文件 .git\refs\heads\master
时,该文件中唯一的内容是 40 个字符的 SHA-1,它验证了上述语句。
现在,下一部分,从此页面引用 - “分支”的定义,就是我所拥有的一个关于 - 的问题
“分支”是一条发展线。分支上的最新提交称为该分支的提示。分支的尖端由分支头引用,分支头随着分支上完成的额外开发而向前移动。
假设名为 feature-400
的分支中有 12 个提交。它们是否通过每个提交跟踪其父级而链接在一起,或者分支本身是否以某种方式跟踪此历史记录?
In a quest to understand Git branches, I've come across the following, cited from this page - toward the bottom,
Because a branch in Git is actually a simple file that contains the 40 character SHA-1 checksum of the commit it points to, branches are cheap to create and destroy.
In a Git repo of one of my projects, when I open this file .git\refs\heads\master
, the only thing in that file is a 40 character SHA-1, which verifies the above statement.
Now this next part, cited from this page - definition for "branch", is what I have a question about -
A "branch" is a line of development. The most recent commit on a branch is referred to as the tip of that branch. The tip of the branch is referenced by a branch head, which moves forward as additional development is done on the branch.
Say there are 12 commits within a branch called feature-400
. Are they chained together by each commit keeping track of its parent or does the branch itself somehow track this history?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
前者,即家长追踪。
The former, i.e., parent tracking.