Multi-git is a quick tool that could easily have been created with some shell scripts, but it's a nice project to tackle a part of my daily workflow. It performs git actions on multiple directories within the current tree.
It will:
- walk the directory tree;
- traverse and find all git projects;
- perform
gitwith all the arguments you passed tomgit. - collect output per directory;
- outputting thread-safe in the main thread;
It can even be tweaked with the environment variable MGIT_PARALLEL
(defaulting to number of cpus times 8).
Keeping your indices up-to-date:
$ mgit fetchKeeping your code up to date (if no conflicts):
$ mgit pull --ff-onlyKeeping your code up to date, rebasing and using autostash:
$ mgit pull --rebase --autostashPer (found) git repository, the output will show:
- The path of the repository on disk.
- The output for the git action on that repository.
As a summary it will show some statistics:
Success: 110, Warnings: 3- Use async.
- Benchmark (and optimize?).
- Updated dependencies.
- Increased default thread count.
- Updated dependencies.
- Updated dependencies.
- Updated libc.
- Updated walkdir dependency.
- Add empty line at the end of the output.
- Updated dependencies.
- Output the amount of projects affected (and the command) up front.
- Moved output collection into spawned thread to release file handles earlier.
- Add a summary at the end of the output.
- Initial working version.