Poe
Poe

Reputation: 3010

recursive diff to create a patch and apply patch recursively

I'm running into trouble using patch. I have 2 folders with many subfolders and files.

diff -ur backup/www/ www/ > sync.patch

Next, I'm trying to apply the patch.

patch < sync.patch

It asks me File to patch: as you can see.

|diff -ur ./backup/www/members/categorize.php ./www/members/categorize.php
|--- ./backup/www/members/categorize.php   2012-12-13 15:19:41.000000000 -0500
|+++ ./www/members/categorize.php   2012-10-15 23:32:12.000000000 -0400
--------------------------
File to patch:

The file ./www/members/categorize.php exists.

Upvotes: 7

Views: 11438

Answers (1)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272467

You probably need to investigate the -p flag for patch, which controls the way that directory prefixes are treated. See the man page.

Upvotes: 6

Related Questions