Git: What did I just pull in?

Sometimes, I run a git pull, and I’m excited to see that someone else has made some changes to the repo. I want to see what they are!

After I run git pull, I see a summary of changes:

remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (1/1), 300 bytes | 300.00 KiB/s, done.
   abc1234..fed7890  master     -> origin/master
Updating abc1234..fed7890
 .gitea/workflows/deploy.yaml | 10 +++++++++-                    |  4 ++++                  |  4 ++++
 3 files changed, 17 insertions(+), 1 deletion(-)

You can then quickly copy paste that commit range into git diff (show me a diff of all changes) or git show (show me each changes from each commit):

$ git diff abc1234..fed7890

This maybe seems obvious, but it still feels like magic to me.

1 Like

Nice tip, thanks for sharing!

git pull is porcelain command which encompasses few of plumbing operations underneath. I usally do git fetch --all to get the changes from all remotes into my workspace but not change anything on my branches locally. you will get same information without applying changes to your local branch.
lest there is a commit which you dont want. Once changes are brought in, one can git log A..B to see the changelogs of the changes and then do git merge or git rebase to apply the changes to local tree.

1 Like