在 hg 中,我可以使用 hg heads
查看所有当前的头像。我仍然无法在 git 中找到等效项。 git-hg rosetta stone没有给出答案。
至于 hg parents
,它在 hg 中简单地告诉节点的直接祖先,rosetta stone 简单地读取非常无用:
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>
和 git rev-list HEAD -1 -- file
是 hg parents
的不同形式的等价物
至于你的分离头问题,做git checkout <sha1>
用于提交检查而不是用于一般工作流程。如果你想要一个提交的分支,你必须做 git branch <name> <sha1>
或 git checkout -b <name> <sha1>
并致力于此。
由于以上原因,我觉得说等价于hg heads
并不理想。在 git 中,所有提交都没有子项,但关闭等效项是 git branch
关于git - hg heads/hg parents 的 git 等价物是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9473456/