I search a tool to loop over N git repos and do git commands (most of the time git diff).

Wanted features:

  • open source
  • command line based

bash can do this.

Write your Git commands in a bash script file called commands.sh:

git clone [...]
git add [...]
git commit [...]
git push
git tag [...]

Then call commands.sh in your loop with a & at the end so that all get fired in parallel without waiting for the previous to finish.

| improve this answer | |

I hacked this simple solution:

cd ~/src
if [ -e "$@" ]; then
   echo 'Please supply git command (for example "status")'
   exit 1;
parallel -j0 "cd {}; echo -- {} ------------- ; git $@; echo " ::: $(find * -maxdepth 2 -name .git -printf '%h\n') 

In my case all git repos are in ~/src.

| improve this answer | |

There is: gr

Multiple git repository management tool http://mixu.net/gr/


  • Tag all the things! gr @work foo will run the command foo in all the paths tagged @work.
  • Auto-discovery of git repositories for easy setup and tag management.
  • gr does not reinvent any git operations: instead, it passes through and runs any unknown commands. All your git-fu will still work! e.g. gr @work git fetch is the same as running git fetch in each all the paths tagged @work.
  • Built-in commands for common pain points: status for one-line summaries of repos (modified, behind/ahead, tags)
  • Extensible via plugins and middleware: REST API/Connect-style request handlers (function(req, res, next) { ... }
| improve this answer | |

clustergit: https://github.com/mnagel/clustergit

clustergit allows you to run git commands on multiple repositories at once. It is especially useful to run git status recursively on one folder.

clustergit supports git status, git pull, git push, and more.

It is a renamed and slightly improved version of Mike Pearce's show_status.

| improve this answer | |

There is git-repo from google: https://code.google.com/archive/p/git-repo/

Repo is a tool that we built on top of Git. Repo helps us manage the many Git repositories, does the uploads to our revision control system, and automates parts of the Android development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android. The repo command is an executable Python script that you can put anywhere in your path.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.