Blogmark

Git Pulled What???

via jbranchaud@gmail.com

https://frankwiles.com/posts/two-handy-git-aliases/
Git

Usually when I'm doing a git command that involves a ref of the form @{1}, it is because I'm targeting a specific entry in the reflog that I want to restore my state to.

Frank points out another use for these right after pulling down the latest changes from a remote branch.

This will display all the commits that were pulled in from the latest pull (e.g. git pull --rebase):

$ git log @{1}..

And this will show a diff of all the changes between where you just were and what was just pulled in:

$ git diff @{1}..

One thing to keep in mind is to be sure that you are using @{1} immediately after you pull. Any other things you might do, such as changing branches, will put another entry on the reflog making @{1} no longer reference your pre-pull state.

In that case, you'd need to do git reflog and find what entry does correspond to right before you pulled.