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

  • Launching into Orbit
    We’re excited to announce today the release of a BioWare project that’s unlike anything we’ve done before. Over the past few months, the BioWare Online Services team has been working hard on the next-generation of our online technology platform: Orbit.
  • The Big SuperTuxKart Update Is Almost Ready
    Towards the end of last year a development version of a big new version of SuperTuxKart was released that brought a new OpenGL 3.1+ graphics engine and other improvements. The new SuperTuxKart game looks great (especially for being an open-source game) and is now closer to being officially released with now having an RC version out.
  • Humble Indie Bundle 14 Drops Torchlight 2, Outlast, and Other Awesome Games on Linux
    Following on the footsteps of the fantastic success of the previous Humble Indie Bundle initiatives, the awesome people behind Humble Bundle, Inc. have put together yet another amazing collection of cross-platform games entitled Humble Indie Bundle 14.
  • New Linux Gaming Survey For April
    The new GOL survey for April is now available, so please make sure to fill it in if you have the time.
  • Team Fortress 2 Update Brings Balancing Fixes
    Team Fortress 2 is an online multiplayer game developed by Valve and it's one of the most popular titles on Steam for Linux. A new update has been released for it, and it applies to the Linux version as well.
  • Grass Simulator Fully Released With Linux Support
    April Fools! Wait, this is real? Grass Simulator added Linux support recently, and today they have released the final version.

Android Leftovers

CentOS 7 Update and Red Hat

  • Latest CentOS 7 Update Brings Support for Intel Broadwell, AMD Hawaii, and Btrfs
    The CentOS development team, through Karanbir Singh, announced at the end of March 2015 that a new build for the stable CentOS 7 Linux operating system is available for download and update.
  • CentOS 7.1-1503 Screenshot Tour
  • Red Hat helping you (J)Boss your Big Data
    New product enhancements are designed to help enterprises get more out of their Big Data.
  • JOSE – JSON Object Signing and Encryption
    Federated Identity Management has become very widespread in past years – in addition to enterprise deployments a lot of popular web services allow users to carry their identity over multiple sites. Social networking sites especially are in a good position to drive the federated identity management, as they have both critical mass of users and the incentive to become an identity provider. As the users move away from a single device to using multiple portable devices, there is a constant pressure to make the federated identity protocols simpler (with respect to complexity), more user friendly (especially for developers) and easier to implement (on wide range of devices and platforms).

Linux in the Old Homestead

My darling daughter Mimi, who had installed Debian when she was 9 (with her proud father watching over her shoulder), had been an Ubuntu user for years. We’ll get to why that was OK with her Dad in a minute. Unity, of course, changed everything: She hated it as much as her father did (and does), and she switched to Linux Mint, which she had been using for the last several years. Read more