I'm guessing it allows you to "save" a merge process so I could create a patch for some Open Source project, and submit a patch so they don't have to handle the merge themselves?
When and how would you use patches in SVN?
A patch is a file that show the differences between two revisions or between your local repository and the last revision your repository is pointing. To share or save a patch of your local uncommitted changes either for peer review or to apply later, do: svn diff > new-feature.patch.
The apply patch is used to add changes saved into a diff file (that is the patch) to the current file/project. Such patches are used e.g. for summarizing changes that can be moved independently of version control systems, such as added as a Bugzilla attachment.
What is patch? patch is a command that takes the output from the diff and puts it into a file. Then, it can take the filed output and overwrite another file with with the changes. For example, a common use is to use the patch to transfer changes from the changed file to the original file, thus making them identical.
patches (unified diff files in svn) are used for various situations:
There are other situations where patchfiles are useful, but those are most very specific to projects.
Without using patchfiles, you'd have to send all your modified files in whole, which usually results in a much bigger (zip) file.
And of course, it's possible to apply a patchfile to a working copy which already has its own modifications - if you would send whole files those local modifications would get overwritten.
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