git diff uses the same pager as less Unix command.
- Use keys
danduto go down / up half pages (forward / backward technically) - Jump to last line:
G - Use
hif you want to display the help
Another trick is storing the diff as a patch file like they used to do in the email days! Then you can open up the patch in any program (Sublime has syntax highlight red/green)
Some examples:
git diff master > ~/patch
git show someCommitSHA > ~/patch
git diff master myBranch -- *.js *.css > ~/patchpatch of js & css diff from master
git apply ~/patch
Normally you would use the patch by applying the diff, but you can just open the file in any text editor. It’s useful if you don’t want to make a full commit out of your diff, but still want to use it somewhere else or send it to a friend
You can also use
git diff master | grep -C 2 someKeywordto show diff +/- 2 lines around some keyword