git - hg heads/hg parents 的 git 等价物是什么?

标签 git

在 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 -- filehg 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/

相关文章:

git - 跟踪已部署应用程序的文件

git hooks 在提交消息中强制执行 JIRA 票号

git - 接受未出现在 VS 代码中的传入更改

git - 如何在使用 "git merge -s ours"选项完成的历史记录中查找 merge 提交?

git push origin [local-branch] 尝试推送到远程主分支而不是创建一个新分支

git - 在 GitHub 上 merge pull 请求后如何同步我的本地主分支?

git - 如何删除 git MERGE_MSG?

git - 将文件添加到 .gitignore 后,git 会从版本控制中删除文件吗?

git - 测试将要在预提交 Hook 中提交的内容

git - 在不推送 merge 提交的情况下更新本地分支?