简体   繁体   English

如何查看使用git分叉存储库后的提交?

[英]How to see the commit after which a repository was forked using git?

I have an original repo A, suppose after commit10 I forked repo B. repo A continued developing and so did repo B. I want to see only things which were added by repoB person ie diff of HEAD and commit10. 我有一个原始存储库A,假设在commit10之后我分叉了存储库B。存储库A继续发展,存储库B也是如此。我只想查看repoB人添加的内容,即HEAD和commit10的差异。

How to figure out what is commit10, at what point was repoB forked? 如何弄清楚什么是commit10,在什么时候repoB被派生了?

There are many similar questions on stackoverflow but they are trying to diff current version of two repos. 在stackoverflow上有很多类似的问题,但是他们试图区分两个仓库的当前版本。 That is different from what I need. 那与我所需要的不同。

Your question is vague but I will still give it a try. 您的问题含糊不清,但我仍然会尝试一下。

You can do a git merge-base --help to get all the options. 您可以执行git merge-base --help获得所有选项。

Looks like you basically want to compare commits across 2 branches in separate forks. 看来您基本上是想比较两个单独分支中的分支的提交。

git merge-base branchA branchB git merge-base branchA分支B

Regarding your point 关于你的观点

How to figure out what is commit10, at what point was repoB forked? 如何弄清楚什么是commit10,在什么时候repoB被派生了?

You can get a graph of the branch history to get an idea of the point when repoB was forked. 您可以获取分支历史记录的图形,以了解repoB被分叉的时间点。 Following command should help 以下命令应该有所帮助

git log --graph --oneline --decorate --all

Look for more options under git log --graph git log --graph下寻找更多选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM