git diff file between branches

maker go

if you’re on a feature branch and want to diff a file against another branch, main in this example:

git diff main -- path/to/file

examples:

git diff main -- Makefile
git diff main -- cmd/app/main.go

the end.