To apply an svn patch (your_patch_file.patch) go to the root of your source directory, and place the patch there. (or you can specify the location of the patch with the patch name if it is not placed in the root of the source tree.)
patch -p0 < your_patch_file.patchSimilarly if you have modified the source tree, and want to create a patch for the changes that you made, from the source root:
svn diff > your_patch_file.patch
or giving the files/folders that you need to get the diff of, along with their relative path.
svn diff path1/file1 path2/file2 path3/file3 > your_patch_file.patch
your_patch_file.patch will be created inside the root of the source tree. (You may specify the location too, as usual)
Similarly,
How to get the svn diff between two commits?
svn diff -r 5224:5225 > your_patch_file.patchgets the commit 5225 for the particular directory.
svn diff -r oldversion:newversion files > your_patch_file.patchgets the diff between the commits newversion and oldversion.
Thank you for the great post, it was very useful because I couldn't get it working with my eclipse plugin (:
ReplyDeleteHi Christy,
ReplyDeleteGlad to know that you found this post useful.
Regards,
Pradeeban.
Thank you!
ReplyDeleteVery helpful thanks :)
ReplyDeleteThe first ">" in this command should be omitted:
ReplyDelete```
svn diff > path1/file1 path2/file2 path3/file3 > your_patch_file.patch
```
Thanks for your report, I was careless. I have fixed it now.
Delete