ski*_*ppy 29 git version-control
我有两个不同的CVS存储库导出到git.他们在某些方面有所不同,我正在调查原因.该开发线可以追溯到几年,并且有数万次提交.
在开发行的开头,每个提交的SHA1 ID都是相同的,告诉我git-cvsimport在读取cvsps和import的结果时非常一致.
但是在第一次提交和昨天之间的某个时间,SHA1 ID开始出现分歧.我想通过比较每个存储库中的提交ID列表并查看缺少的内容来找出它的位置.这样做有什么好的工具或技术吗?
eph*_*ent 34
由于两个git存储库的开头相同,因此可以将两者都放到同一个工作存储库中.
$ git remote add cvsimport-a git://.../cvsimport-a.git
$ git remote add cvsimport-b git://.../cvsimport-b.git
$ git remote update
$ git log cvsimport-a/master..cvsimport-b/master # in B, not in A?
$ git log cvsimport-b/master..cvsimport-a/master # in A, not in B?
Run Code Online (Sandbox Code Playgroud)
Jas*_*yon 18
为什么不把每个repo的git log记录到自己的文件中并进行比较?最接近文件底部的差异是他们开始分歧的地方......
Bri*_*ell 12
在您的一个回购中,执行以下操作:
$ git remote add other-repo git://.../other-repo.git
$ git remote update
$ git log other-repo/master...master
# or maybe:
$ gitk master... other-repo/master
Run Code Online (Sandbox Code Playgroud)
这为您提供了两个回购之间的对称差异; 这将显示一个仓库中的所有提交,而不是另一个仓库.
显而易见的方法是克隆一个存储库,将另一个存储库的主分支的尖端读取到克隆中,并在两个提示上使用git merge-base来查找共同的祖先.