0

My build is modifying a large file (~256MB) and I want to diff it to the pristine copy. Using a diff tool takes too long and listing the contents is enough for me.

I can do this to list the current contents

 unzip -l build.war > current.txt

How can I get the unmodified copy from git (so that I can do the same thing then diff the text files)? Ideally I don't want to reset the current copy (i.e. I want to leave it in its current modified state)

opticyclic
  • 7,412
  • 12
  • 81
  • 155

1 Answers1

1

You can get the unmodified version with

git show HEAD:build.war

So to diff the contents of both archives, run:

git show HEAD:build.war > build.tmp
unzip -l build.tmp > unmodified.txt
unzip -l build.war > current.txt
diff unmodified.txt current.txt
Justin Howard
  • 5,504
  • 1
  • 21
  • 48