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

Re: Git remote status

From
Jeff King <peff@peff.net>
Date
Nov 2, 2008, 03:30 UTC
Message-ID
<20081102033056.GA4936@coredump.intra.peff.net>
In-Reply-To
<490CB390.9000206@gmail.com>
On Sat, Nov 01, 2008 at 08:52:48PM +0100, Gonsolo wrote:
Show 5 quoted lines
> If I switch branches with "git checkout master" git tells me something  
> like "Your branch is ahead of the tracked remote branch 'origin/master'  
> by 39 commits".
> Is there a "git remote status" or git-status switch to get the same  
> information without switching branches?

"git status" will do this automatically in recent versions of git (as of 1.6.0, I believe).

You can also use "git branch -v" to see a summary of how all branches relate to their tracked counterparts.

> Sometimes it's valuable whether one should push changes (for example  
> before installing a new Ubuntu version ;) ).
For that, I might want to actually _see_ the changes. So I would use:
  git shortlog origin/master..

(or "log" with a variety of formatting options to get as much information as you like). And if the relationship is more complex (i.e., I want to see if I need to push _or_ pull):

  gitk origin/master...
-Peff
Previous: Miklos Vajna
Message 3 of 3 in “Git remote status”
  1. GonsoloNov 1, 2008
  2. Miklos VajnaNov 1, 2008
  3. Jeff KingNov 2, 2008

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.