Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Contacts: Diff & Patch
- SEE Diff&Patch: How To
- cd BACKUPS/Contacts/
- mkdir patches
- cp gmail-contacts-00001.vcf GmailContacts.vcf ./patches/
- cd patches/
- 1. Clearly mark OLD and NEW files:
- rename files to *-old and *-new
- $ mv gmail-contacts-00001.vcf gmail-contacts-old.vcf && mv GmailContacts.vcf gmail-contacts-new.vcf
- 2. Compare files:
- create the patch file using diff command
- $ diff -u gmail-contacts-old.vcf gmail-contacts-new.vcf >gmail-contacts.patch
- 3. Validate the Patch without Applying (Dry-run Patch File):
- You can dry run the patch command to see if you are getting any errors, without patching the file using –dry-run option.
- $ patch --dry-run < gmail-contacts.patch
- 3. Update OLD file:
- create backup file of gmail-contacts-old.vcf before patching i.e. creates gmail-contacts-old.vcf.orig before applying patch to the older filer
- $ patch -b < gmail-contacts.patch
- You can also use -V to decide the backup filename format as shown below. Now you will have a file name “gmail-contacts-old.vcf.~1~”.
- $ patch -b -V numbered > gmail-contacts.patch
- 4. Reverse a Patch that is Already Applied (Undo a Patch)
- You can use the -R option to reverse a patch which is applied already:
- $ patch -R < gmail-contacts.patch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement