I am on Linux, working on forking a PHP project. I want to create a patch file of the work that I have done, that can be applied to the latest parental code. Both original folder and new code folder are many subdirectories deep (so need recursive).
For some reason when I do :
diff -ur folder1 folder2 > newcode.patch
I don't manage to get the patch file including all of the new files, and it doesn't even contain some of the deeper file changes ( about 3+ levels deep).
Any ideas how to go about this? I've looked at Meld and Kdiff3...but they don't appear to do what I want either.
I suspect you have a directory structure that's something like :
folder1/
text.txt
level1/
text1.txt
level2/
text2.txt
level3/
text3.txt
folder2
text.txt
level1/
text1.txt
level2/
text2.txt
anewdirectory/
newtext.txt
level3/
text3.txt
newfiled3.txt
In this case, diff
will ignore the file newtext.txt
within anewdirectory/
. It probably also doesn't pick up the text of newfiled3.txt
either. Instead it reports something like :
..
Only in folder2/level1/level2/ : anewdirectory
Only in folder2/level1/level2/level3/ : newfiled3.txt
..
Is this the symptom you're seeing?
Try :
diff -urBNs folder1/ folder2/ > code.patch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With