If you are using a Unix system, this method might be really helpful to patch. Assume your source directory name is "test" and one of your code contributors got the same source directory.Now, you make a replicate directory of "test" called "testm" and do some changes to the source inside it. After a unit test, you want to send the modified source as a patch to your contributor.
Open up a terminal and change the location to the parent directory of "test" and "testm".
- diff -Naur test testm > testpatch1.patch
Send the "testpatch1.patch" to the contributor and they should apply this patch to their source.
- patch -Np1 --ignore-whitespace -d test < testpatch1.patch
Note: In this "diffing" and "patching" approach, you can include not only changes but also newly added files to the patch.