I have two directories: Libc-825 and Libc-1044. Imagine that version 1044 is newer, but buggy. Is there a way to merge these file trees? I have there C sources with not so big differences. I have heard of using git for such purposes.

Edit: I want to get diffs of all the files where names clash, to fix bugs manually

  • What would you want to achieve with the merge? It sounds like you want the merge to "magically" fix the bugs in 1044 while keeping its functionality. Please edit your question to explain – roaima Jan 29 '16 at 0:00

You could use diff to generate a patch with new, old and conflicting files.

diff -Naur Libc-825 Libc-1044

The flags state -N treat missing files as new, -a all files are text, -u show lines before and after diff for easier identification and -r recursive. You can then apply the patch to the old directory and get the merged results.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.