什么是hg head / hg父母的git等价物? [英] What is the git equivalent of hg heads / hg parents?

查看:128
本文介绍了什么是hg head / hg父母的git等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



至于 hg父母这些在hg中告诉节点的直接祖先,rosetta stone只是读取非常无益的内容:

  git log#你可以从那里阅读你需要的所有信息(只要你已经知道你问的问题的答案)


解决方案

git rev-list HEAD , 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屋!

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