English
Ask Your Question
1

using diff with directories

asked 2012-02-14 11:06:38 +0000

Hi guys,

I have a directory named souce1. then I copy contents to source2. then I add index.html in source2. I use diff to generate patch file:

diff -Naur source1 source2 > patch.txt

Now I delete source2. When I use patch < patch.txt to generate source2 it gives error:

The next patch would create the file index.html,
which already exists!  Assume -R? [n]

I read man pages but confused with a lot of options, can someone explain the usage of -N?? How can I fix this problem?

edit retag flag offensive close delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-02-14 15:27:11 +0000

updated 2012-02-14 15:28:00 +0000

You probably forget the -p option

patch -p0 <patch.txt

or

cd source1 ; patch -p1 <../patch.txt
edit flag offensive delete publish link more

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

Add answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers to your questions.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Stats

Asked: 2012-02-14 11:06:38 +0000

Seen: 177 times

Last updated: Feb 14 '12

Related questions