5

For example I have two directories say old and new. The directory old has a sub-directory abc and the directory new has a sub-directory cde. I tried creating patch by using

diff -ru old/ new/ > file.patch

I got following output in file.patch:

Only in old/: abc
Only in new/: cde

and when I tried to patch the file I got following error:

patch: **** Only garbage was found in the patch input.

When I try to create patch by using:

diff -ruN old/ new/ > file.patch

I get empty file.patch.

Is there any way to create a patch that when patched to old would delete abc and create cde in old?

1 Answer 1

1

The makepatch script is useful for this. I use this for almost all source-patches, along with diffstat. There is also applypatch (completing the task), though I do not use it myself.

The GNU diff new-file "-N" option does (used to not...) work with the recursion option "-r". So you could use

diff -r -N old new

I just verified that it works for diff 3.0 (which by now is rather old).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.