什么是hg head / hg父母的git等价物? [英] What is the git equivalent of hg heads / hg parents?
问题描述
在hg中,我可以使用 hg头
来查看所有当前的头像。我仍然无法在git中找到等价物。 git-hg rosetta stone 没有给出答案。
至于
git log#你可以从那里阅读你需要的所有信息(只要你已经知道你问的问题的答案)
git rev-list< sha1>
和 git rev-list HEAD -1 - file
是不同形式的 hg父母
的等价形式。至于你分离的HEAD问题, git checkout< sha1>
用于提交检查,不适用于一般工作流程。如果你想要一个提交的分支,你必须做 git branch< name> < sha1>
或 git checkout -b< name> < sha1>
然后开始工作。
由于上述原因,我觉得谈论相当于 hg头
在git中是所有提交都没有孩子,但是等价的关闭是 git branch
In hg I can use hg heads
to view all current heads. I still have not been able to find an equivalent in git. The git-hg rosetta stone doesn't give an answer.
As for hg parents
which in hg simply tells the direct ancestors of a node the rosetta stone simply reads the very unhelpful:
git log # you can read all the information you need from there (as long as you already know the answer to the question you're asking)
git rev-list HEAD
, git rev-list <sha1>
and git rev-list HEAD -1 -- file
are the equivalents of the different forms of hg parents
As for your detached HEAD problem, doing git checkout <sha1>
is meant for commit inspection and not for general workflow. If you want a branch off a commit, you have to do git branch <name> <sha1>
or git checkout -b <name> <sha1>
and work on it.
Due to the above reason, I feel that it is not ideal to talk of the equivalent to hg heads
in git as being all commits that don't have a child, but the closes equivalent is git branch
这篇关于什么是hg head / hg父母的git等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!