Language Selection

English French German Italian Portuguese Spanish

How to Create Patch Files Using Patch & Diff

Filed under
HowTos

Patch file is a readable file that created by diff with -c (context output format). It doesn’t matter and if you wanna know more, man diff. To patch the entire folder of source codes (as usually people do) I do as below:

Assume Original source code at folder Tb01, and latest source code at folder Tb02. And there have multiple sub directories at Tb01 and Tb02 too.

diff -crB Tb01 Tb02 > Tb02.patch

-c context, -r recursive (multiple levels dir), -B is to ignore Blank Lines.
I put -B because blank lines is really useless for patching, sometimes I need to manually read the patch file to track the changes, without -B is really headache.

Full Story.

compare files and edit simultaneously with vimdiff

Refers to How to create patch file using patch and diff, you can actually read the diff file to compare the difference between the files. But what if you wanna compare and edit simultaneously?

Given 2 different files at your hand, you can do that with vimdiff. Let say I wanna compare this two files Tb01/TbApi.cpp and Tb02/TbApi.cpp, I can do this

vimdiff Tb01/TbApi.cpp Tb02/TbApi.cpp

More Here.

----
You talk the talk, but do you waddle the waddle?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

More in Tux Machines

Leftovers: Gaming

Leftovers: Screenshots

New To Linux? Don’t Use Ubuntu, You’ll Probably Like Linux Mint Better

Linux newbies have probably heard a lot about Ubuntu, but it isn’t the only Linux distribution. In fact, Ubuntu’s standard Unity desktop is still controversial among long-time Linux users today. Many Linux users prefer a more traditional desktop interface, and Linux Mint offers that. As Ubuntu focuses more on Ubuntu for phones, Linux Mint may be an even clearer choice in the future. No, Ubuntu isn’t terrible. Some people prefer Ubuntu’s Unity desktop and love it. But you’ll probably have an easier time getting to grips with Linux Mint instead of Ubuntu. Read more

IceCat 31.4.0 release

GNUzilla is the GNU version of the Mozilla suite, and GNU IceCat is the GNU version of the Firefox browser. Its main advantage is an ethical one: it is entirely free software. While the Firefox source code from the Mozilla project is free software, they distribute and recommend non-free software as plug-ins and addons. Also their trademark license restricts distribution in several ways incompatible with freedom 0. https://www.gnu.org/software/gnuzilla/ Read more