Git Tips Slides
PageUp x2: previous · PageDown x2: next · Home: index

git diff of pull-request

You work on a PR, and you execute:

git diff origin/main

But this might look very different from what you see in the web UI of your Git hosting provider.

That simple git diff command might show a lot of changes that happened on origin/main since you created the branch. You do not want to see those changes.

What was changed on your branch since the branch was created?

git diff origin/main...

Unfortunately this does not show your local changes, which are not committed yet.

To see them, too:

git diff "$(git merge-base origin/main HEAD)"