在 hg 中,我可以使用 hg heads 查看所有当前磁头。我仍然无法在 git 中找到等价物。 git-hg rosetta stone 没有给出答案。

至于 hg parents,它在 hg 中只是简单地告诉节点的直接祖先,罗塞塔石碑只是简单地读取了非常无用的内容:

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 HEADgit rev-list <sha1>git rev-list HEAD -1 -- filehg parents 的不同形式的等价物

至于你的分离头问题,做 git checkout <sha1> 是为了提交检查而不是一般工作流程。如果你想要一个提交的分支,你必须做 git branch <name> <sha1>git checkout -b <name> <sha1> 并处理它。

由于上述原因,我觉得在 git 中将 hg heads 等同于所有没有 child 的提交是不理想的,但关闭等同于 git branch

关于git - hg head/hg parents 的 git 等价物是多少?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9473456/

10-14 15:32
查看更多