术语“头部”,“头部”和“尖端”如何使用?不同? [英] How are the terms "HEAD", "head", and "tip" different?

查看:182
本文介绍了术语“头部”,“头部”和“尖端”如何使用?不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 表示 current 分支。

  • 因此,只有一个HEAD。

  • "indicates the head of the current branch."
  • so, there is only one HEAD.

  • 指的是 any 分支的最新提交。

  • ...分支的最新提交(或头)...

  • 因此,有分支。

  • refers to the most recent commit of any branch.
  • "...the most recent commit (or "head") of a branch..."
  • so, there are as many heads as there are branches.

  • any 分支的最新提交。

  • 因此,tip是 head

  • 的同义词
  • refers to the most recent commit of any branch.
  • so, tip is synonymous with head

如果我错了,请纠正我。另外,请提供有关小费用法的文档。

Please correct me if I'm wrong. Also, please provide documentation on the usage of "tip".

每个分支指向一次提交。 head(或tip)是分支指向的提交。如果有十个分支,则有十个标题和十个提示!

Each branch points at a commit. The head (or tip) is the commit at which a branch points. If there are ten branches then there are ten heads and ten tips!

HEAD是您在这里标记,它以两种方式之一指向一次提交:在这种情况下,HEAD指向一个分支,该分支又指向一个提交;其他时间,HEAD直接指向一次提交。后者称为分离头。

HEAD is a "you are here" marker that points at a commit in one of two ways: most of the time, HEAD points to a branch which in turn points at a commit; other times, HEAD points directly at a commit. The latter is called detached HEAD.

语录为来自git(1)

推荐答案

分支(又名分支头)标记您回购中的兴趣点。这个比喻并不完美,但是您可以将分支视为某种书签。每个分支都指向一个提交;该提交称为分支的 tip

Branches (a.k.a. branch heads) mark points of interests in your repo. The metaphor isn't perfect, but you can think of branches as some sort of "bookmarks". Each branch points to a commit; that commit is called the tip of the branch.

HEAD (注意大写) ) 是不同的。它通常指向分支,指示您当前在回购中的兴趣点。但是,在某些情况下, HEAD 也可能直接指向提交(在这种情况下,您的存储库据说具有分离的HEAD)。

HEAD (note the uppercase) is different. It usually points to a branch, indicating which point of interest in your repo you're currently at. However, in some cases, HEAD may also point directly to a commit (in which case your repo is said to have a "detached HEAD").

您可以将 HEAD 视为


  1. 地铁地图上的您在这里标记,即您的提交图;或

  2. 当前检查出哪个分支(如果有)的指示。

例如,在以下存储库中, master 分支的 tip 是缩写ID f42c5 ; develop 分支的 tip 是缩写ID 190a3 的提交; HEAD 指向 master ,表示当前已检查 master

For instance, in the following repository, the tip of the master branch is the commit of abbreviated ID f42c5; the tip of the develop branch is the commit of abbreviated ID 190a3; HEAD points to master, indicating that master is currently checked out.

这篇关于术语“头部”,“头部”和“尖端”如何使用?不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆