Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN Patch - with multiple files

I am trying to make a patch with multiple files in different directories. I don't want to include all my uncommitted files as I have a lot not applicable to the patch.

I know of this command to create a patch with a specific file, only issue is this is one file:

svn diff -up original.php > filename.patch

Is there any way to do this with multiple files in different directories ?

Thanks

like image 304
Sunjalo Avatar asked Nov 02 '12 09:11

Sunjalo


People also ask

How do I create a patch in svn?

Creating a Patch File First you need to make and test your changes. Then instead of using TortoiseSVN → Commit... on the parent folder, you select TortoiseSVN → Create Patch... you can now select the files you want included in the patch, just as you would with a full commit.

How does svn patch work?

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. In order to apply the patch successfully, you must run the command from the same path where the patch was created.

What is svn diff?

The svn diff command reveals the differences between your working copy and the copy in the master SVN repository.

How do patch files work?

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.


1 Answers

You can try used: svn diff -r BEGIN_REVISION:END_REVISION > patch_file.patch This will make the patch on all modified files.

If you want create patch for concrete files, you can enumerate them before >.

svn diff dir_name_1/first.php dir_name_2/second.php > patch_file.patch

For one directory: svn diff -uRp dir_name > patch_file.patch

I'll hope it helps you.

like image 179
Ruu Avatar answered Sep 19 '22 15:09

Ruu