gpt4 book ai didi

Git 术语 : Difference between tip and HEAD?

转载 作者:行者123 更新时间:2023-12-05 01:45:53 27 4
gpt4 key购买 nike

Git HEADtip 有什么区别?

很抱歉,如果有人在其他地方问过这个问题......还没有看到任何其他问题。

最佳答案

来自 gitglossary (可能在安装了 git 的计算机上通过 git help glossary 访问。):

branch
A "branch" is an active 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.

head
A named reference to the commit at the tip of a branch. Heads are stored in a file in $GIT_DIR/refs/heads/ directory, except when using packed refs. (See git-pack-refs[1].)

HEAD
The current branch. In more detail: Your working tree is normally derived from the state of the tree referred to by HEAD. HEAD is a reference to one of the heads in your repository, except when using a detached HEAD, in which case it directly references an arbitrary commit.

“头部”有两个定义,以大写区分,似乎确实存在混淆的余地。但一个快速的总结似乎是:

A 提示 是分支上的最新提交。每个分支有一个提示

A head(全部小写)有点像标签,因为它是对分支尖端的方便命名引用。与标记不同,head 将在您将提交添加到分支时自动更改它引用的提交。每个分支有一个 head

HEAD(全部大写)是您当前 checkout 的任何提交。只有一个 HEAD

关于Git 术语 : Difference between tip and HEAD?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39752604/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com