2

I work in an agency so we work on a lot of different projects and git repositories during the week.

I'd like to use git from the command line (rather than a GUI) but one thing I'm missing is a reliable, quick, easy way to see which of the repositories I've been working on I've forgotten to commit/push.

I can use git status and git branch on individual repositories which is helpful but this approach would take a while each time I just want to 'check all the things'.

Is there a simple way to check all the git repositories' statuses from the command line in one go?

In an ideal world I'd never forget to commit or push or fetch or pull but I know this isn't realistic.

I'm on OS X and my repository directories sit in a common 'Sites' folder.

Mark Stickling
  • 394
  • 3
  • 17

2 Answers2

1

Check out the following tools, they cover your use case quite well:

All of these allow you to manage multiple Git repos from command line, through means of bookmarking, tagging or configuration.

I have not used any of these, but gr looks pretty cool.

nwinkler
  • 52,665
  • 21
  • 154
  • 168
  • Ahh awesome thanks, i'll look through these in a little bit. I'd just worked out this one liner, but it's crude: `for dir in ./*; do (cd "$dir" && git status); done` – Mark Stickling Oct 12 '15 at 15:52
0

The key to this answer is the command git branch -vv (double verbose), using this alone may give enough overview of a single repository whilst saving time. It will print the branches with their local statuses.

However,

I have currently settled on a combination of http://mixu.net/gr/ (thanks @nwinkler) and the command git branch -vv.

Once Gr is set up (tutorial on the site) you can use a combo command such as:

gr @tag git branch -vv

This will list all the repositories tagged in gr with their branches and their statuses.

I don't believe it will notify if there is anything to pull from remote repositories. Even so, the command git branch -vv -a will also list remote repositories.

With gr the complete command is gr @tag git branch -vv -a.

Mark Stickling
  • 394
  • 3
  • 17