Last Updated: February 25, 2016
·
1.728K
· croaky

Comparing zip and git versions of the same codebase

For a consulting project, I was given two versions of the same codebase: one as a zip file, one as a git repository. I needed to determine:

  • Were these exactly the same?
  • If not, which was the newest version of the code and what were the changes?

Git was able to give me the best comparisons. I copied the .git directory into the directory from the zip I got, and ran git diff.

unzip source.zip
cp -R from_git/.git from_zip
cd from_zip
git diff

I was then able to see that the git version was newer than the zip version, its exact additions and deletions, and report back to my client.