Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
618 views
in Technique[技术] by (71.8m points)

version control - How do I compare two git repositories?

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.

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Since the two git repositories start out the same, you can pull both into the same working repository.

$ 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?

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...