Compare
git diff myfile
Compare without caring about spaces:
git diff -b 6eb715d..HEAD
or:
git diff --ignore-space-change 6eb715d..HEAD
Compare without caring about all spaces:
git diff -w 6eb715d..HEAD
or:
git diff --ignore-all-space 6eb715d..HEAD
git log --oneline myfile
git log -p myfile
Compare branches
git checkout <branch_name>
// go to the branch you want to check differencegit diff origin/<branch_name>
// now you can check difference
git diff master..branchname
git diff <local branch> <remote>/<remote branch>
git diff master origin/master
git diff featureA origin/next
git diff origin // if you just compare with your upstream branch.