How to Create Patch Files Using Patch & Diff
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.
- Login or register to post comments
- Printer-friendly version
- 3921 reads
- PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
digiKam 7.7.0 is releasedAfter three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release. |
Dilution and Misuse of the "Linux" Brand
|
Samsung, Red Hat to Work on Linux Drivers for Future TechThe metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world. Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility. |
today's howtos
|
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?