git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: how to find all changes since last push?

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Feb 5, 2009, 18:09 UTC
Message-ID
<taV0I1IK8JVRVNrt3HLsDn5Un88C8ORocUX6BbHDSJg@cipher.nrlssc.navy.mil>
In-Reply-To
<30903.1233854948@relay.known.net>
layer wrote:
Show 9 quoted lines
> I'm a git noob, and I'm trying to move my organization to it from CVS
> (which we've used since 1991).  Currently stuck on this:
> 
> I think a natural style of development using git would be to do a
> series of commits to my local repo and when things are stable, do a
> push somewhere or collect all the changes into a patch.
> 
> I have googled and looked at documentation, but I cannot figure out
> how to find all changes since my last push.

Let's assume that the defaults are used. Your branch is named master, your remote is named origin, and the remote branch is named master also.

  $ git push                 # changes pushed upstream
  # edit, test, commit ...   # make new commits
  $ git log origin/master..  # show new commits since last push
>  To make this more
> complex, I'd like intervening pull's not to interfere with my ability
> to find all changes since the last push.
  $ git fetch                # fetch the changes others have committed
  $ git log origin/master..  # still shows new commits on your master since
                             # last push

'git log origin/master..' is really short for 'git log origin/master..HEAD', or for this example, in place of 'git log origin/master..master'. It is showing the commits that exist on master that do not exist in origin/master.

To see what new things have been applied to origin/master that you do not have in master (i.e. after the 'git fetch'), switch it around:

  $ git log master..origin/master
-brandon
Previous: layer
Message 2 of 2 in “how to find all changes since last push?”
  1. layerFeb 5, 2009
  2. Brandon CaseyFeb 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.