I am trying to create a patch file to be used via reviewboard.
It will be the initial patch.
diff -ruN --exclude=.git empty_dir working_dir > mypatch_00.patch
works but I am getting a "The selected file does not appear to be a diff." error.
Is there any way to get it working using git-diff or diff? Thank you
If you want the full diff from nothing to a particular commit, there is an easier way than in the accepted answer:
The value of
${empty_tree}
is always4b825dc642cb6eb9a060e54bf8d69288fbee4904
but I prefer not to have the magic number in there.If you want to get diff for your initial commit (maybe I misunderstood your question), you can display it using
Alternatively to get it as file:
Where
COMMIT
is revision of this commit. If this is your current commit as well, you don't have to specify it at all.However if your commit is not initial and you want to get full diff for your history, you need to create empty branch first:
Now you can do full diff against empty branch:
I prefer "empty" as a tag. Simplest way is:
Because tag can point to tree-ish directly, without commit. Now to get all files in the working tree:
Or the same with stat:
All files as diff:
Check whitespaces in all files: