Git-head(小写)vs HEAD(大写) [英] Git - head (lowercase) vs HEAD (uppercase)

查看:137
本文介绍了Git-head(小写)vs HEAD(大写)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我理解的正确吗,Git头(小写)和Git HEAD(大写)之间的区别是,前者是 end commit ,而后者只是当前提交 strong>(是选择末端提交还是非末端提交作为HEAD提交)?

Did I understand correct and the difference between Git head (lowercase) and Git HEAD (uppercase) is that the former is the end commit and the latter is just the current commit (whether an end-commit or a non-end commit chosen to be the HEAD commit)?

结束提交"是指最后一次提交给定分支".

By "end-commit" I meant to "last commit of a given branch".

推荐答案

git的命令行中,您编写:

In the command line of git you write:

HEAD是当前提交,即当前在工作目录中检出的提交.

HEAD is the current commit, that is the commit that is currently checkout out in the working directoy.

head本身对GIT而言没有任何意义,除非您具有名为head的分支或标签.但这听起来是个坏主意.

head, as is, means nothing for GIT, unless you have a branch or a tag named head. But that sounds like a bad idea.

但是,当文档讨论分支的 head 时,它指的是该分支的最后一次提交,也许这就是您对 end commit 的意思.在实际命令中,您将使用分支的名称,例如master(或对于远程头为origin/master),而不是文字词head.

But when the documentation talks about the head of a branch it refers to the last commit of that branch, maybe that is what you mean with end commit. In real commands you will use the name of the branch, such as master (or origin/master for the remote head), not the literal word head.

这篇关于Git-head(小写)vs HEAD(大写)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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