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

SMPlayer 14.9 Review – One of the Best Movie Players for Linux

In this article I will overview the main things that make SMPlayer stand out of the crowd, putting it on the top of the video playback applications list. SMPlayer is written in Qt 4.8 and uses MPlayer2 for video playback. Personally I have only words of praise for this player, which is why I decided to write this review. So let’s proceed and see what the most important features of SMPlayer are. Read more

Kano Ships Its First 18,000 Learn-To-Code Computer Kits, Fueled By $1.5M Kickstarter

Kano Computing, a startup that plays in the learn to code space by adding a step-by-step hand-holding layer atop the Raspberry Pi single-board microcomputer to make hacking around with code and learning about computational thinking child’s play, has shipped all the hardware kits in its first batch of crowdfunded orders and pre-orders. Read more

elementary OS: Don't Hate Me Because I'm Beautiful

Ubuntu is a very popular base and it's used by too many systems to count. Ubuntu itself is based on Debian, but for now we’ll stick with Ubuntu. elementary was not supposed to be an operating system, and in fact it started its life just as a collection of themes and a few other packages that allowed users to make Ubuntu look different. The developers soon realized that they could do better than this and made their own operating system. Only two versions of it have been released until now, Jupiter and Luna. They are now working on a third one called Freya, which is in the Beta stages. What is happening with this incredible rate of adoption for this OS and why is it so popular? Read more

Honda Connect in-vehicle infotainment system has Tegra inside and runs Android

The 2015 model of Honda Civic, Civic Tourer and CR-V will be the first vehicle to ship with Honda Connect, and that will be on the European models. Honda Connect looks nice, but a standalone infotainment system that can be used on any car is a much better idea. Read more