gitversion-control

How to show "new" commits in git


I do

git pull

to get new commits from remote and merge them with my local branch.

How can I list the commits that "just came in" ?


Solution

  • If you are just interested in a specific branch (e.g., master), you can take the line in the output of git fetch that has that branch's name:

    6ec1a9c..91f6e69  master     -> origin/master
    

    and use it to construct a git log command

    git log --graph --decorate 6ec1a9c..91f6e69
    

    The two periods mean "all commits that are in the second commit (origin/master) but are not in the first (master)", which is what you are looking for.