How to view file diff in git before commit
To check for local differences:
git diff myfile.txt
or you can use a diff tool (in case you’d like to revert some changes):
git difftool myfile.txt
git difftool more efficiently, install and use your favourite GUI tool such as Meld, DiffMerge or OpenDiff.
Note: You can also use
. (instead of filename) to see current dir changes.
In order to check changes per each line, use:
git blamewhich will display which line was commited in which commit