2

I have a git repository that contains two branches, master and experiments. The latter contains experiments that do not belong in branch master, but may later be merged so I'd like to keep it up to date with changes made to master.

To do so, I run git fetch (from any branch), then have to checkout to master to run git status (and possibly git whatchanged) and know whether I need/want to update master from the remote (and merge it to experiments).

Did I miss a git command/option to get the status of master (ie, whether or not fetch downloaded commits to master that need to be merged, and what commits were downloaded) without having to change branch first?

Aimery
  • 1,559
  • 1
  • 19
  • 24

1 Answers1

5

git status gives you the status of your working tree and not a single branch.

If you want to see whether master is ahead of experiments, you can do a diff between the two branches or do a log from one of them to see if it covers the other.

Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169