Saturday, 14 January 2017

How to Use diff and patch to Compare and Merge Things/Versions

I was working on a few test branch versions this week and I've discovered some bugs. When I want to return to the developing branch versions, I'd like to find out what did I do to fix the bugs and patch them into the developing versions. Therefore, I need to use diff and patch to do that.

(1) diff
Suppose I am comparing directory/folder/file A and B:
                            diff -c -a -b -x *.tag -x *.log A B > AB.diffexplanation:
    > -c     output difference with content format
    > -a     compulsory text mode
    > -b     ignore blank difference
    > -x     filter the files don't want to be compared (more patterns apply)

(2) patch
to be continue...


ref:
http://blog.csdn.net/magicpang/article/details/3030089

No comments:

Post a Comment