aultimus
aultimus

Reputation: 803

How to turn a git repository into a single .diff file that can be applied with patch

I have multiple git repositories and would like to generate a big .diff file for each repository.

This .diff patch would then be applied by a customer using something like the 'patch' utility to generate the files in the repository minus git history.

Does anyone know how I would be able to do this?

Thanks for your time, Matt

Upvotes: 0

Views: 203

Answers (2)

aultimus
aultimus

Reputation: 803

git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 > diff-against-nothing.patch I discovered git's magic empty SHA1!

Upvotes: 1

larsks
larsks

Reputation: 312430

If you want to diff against nothing...why not just do that?

$ mkdir empty
$ ls
empty myproject
$ diff -ruN empty myproject > diff-against-nothing.patch

Upvotes: 1

Related Questions