git diff
- compare the file from two different branches:
git diff <branch a name> <branch b name> <file path>
: in terminal, the file shows up with differences, the marker “^M” means “carriage return”. comparison is based on branch a, and shows how branch b differs from branch a. with red marks deletion of lines in branch a in the current branch b, and green marks new insertion.