shell> vimdiff file1 file2 ~OR~ shell> vim file1 file2 Create a vertical split window: Control-w v Enable visual diff on the left side: :diffthis Move the cursor to the right side buffer: Control-w Right-arrow Enable visual diff on the left side: :diffthis You should now see the differences highlighted on both sides.
To get just a list of files changed since the last commit: git diff –name-only To create a global alias called ‘git changed’: git config –global alias.changed ‘diff –name-only’
To use the patch file, apply it to the original. The patch command will create a backup with the extension .orig, and the original file will be updated:
1
2
3
4
5
6
~$patch-bmyfile<myfile.patch
~$ls
myfile
myfile.modified
myfile.orig
myfile.patch
You may need to add the flag –ignore-whitespace to the patch command.