2

In Git, I'd like to be able to see, at a glance, whether my repository and working directory are out of date. I often make the mistake of just running "git status" - but that doesn't do any remote communication at all. Or, I'll do this:

git fetch --all
git status

But that doesn't show activity on other branches.

What's a good, convenient way to get information like:

  1. Are there updates to this branch in any remote repository?
  2. Are there updates to any parent branch?
  3. Have any new branches been made - who by, etc.
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219

2 Answers2

2

I recommend using gitk --all. This will start a graphical interface displaying all local and remote branches. In console mode, I am using the following git alias:

graph = log --graph --all --decorate --oneline

But beware, working directory is not to be confused with branches... What I just said is true for looking at branches, but changes in the working directory (so, uncommited stuff) is completely different, and shown by git status as you said.

François
  • 7,988
  • 2
  • 21
  • 17
1

You can't get "who by" since branch creation is not actually recorded anywhere. (You can find who owns the most recent commits on a given branch, but, e.g., if the branch was created as synonymous with another branch, the commits often have nothing to do with "who created it". For instance if I do git push origin master:newbranch then the branch I just created on the remote has, as its most recent commit, the same most-recent commit as master, which is not necessarily "mine".)

The output from git fetch --all does show activity by default, though. For instance:

$ git fetch --all
Fetching origin
Fetching rohan
From [redacted]
   55f37f2..dc439fc  master     -> rohan/master

This says that I've just updated my idea of rohan/master based on stuff I brought over from the remote I named "rohan". Nothing was updated in origin/*.

torek
  • 448,244
  • 59
  • 642
  • 775