本文介绍了如何比较两个 git 存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个不同的 CVS 存储库导出到 git 中.它们在某些时候会出现分歧,我正在调查原因.开发线可以追溯到几年前,提交了数万次.

I've got two different exports of our CVS repository into git. They diverge at some point, and I'm doing some investigation into why. The development line goes back several years and over tens of thousands of commits.

在开发线的开头,每次提交的 SHA1 ID 都是相同的,这告诉我 git-cvsimport 在读取 cvsps 和导入的结果时所做的事情非常一致.

At the beginning of the development line, the SHA1 IDs for each commit are identical, telling me that git-cvsimport is very consistent about what it is doing when it reads the results of cvsps and imports.

但是在第一次提交和昨天之间的某个时间,SHA1 ID 开始出现分歧.我想通过比较每个存储库中的提交 ID 列表并查看缺少的内容来找出它的位置.有没有什么好的工具或技术可以做到这一点?

But sometime between the first commit and yesterday, the SHA1 IDs begin to diverge. I'd like to find out where this is by comparing a list of commit IDs from each repository and looking to see what's missing. Are there any good tools or techniques for doing this?

推荐答案

为什么不直接将每个 repo 的 git log 放到自己的文件中并进行比较?最接近文件底部的差异是它们开始分歧的地方...

Why not just cat each repo's git log to its own file and compare? The difference closest to the bottom of the file is where they started diverging...

这篇关于如何比较两个 git 存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 05:50