#cli #git #parallel

app mgit

Run git on multiple projects

11 releases

0.1.10 May 25, 2020
0.1.9 May 7, 2020
0.1.8 Apr 3, 2020
0.1.7 Mar 24, 2020
0.1.5 Feb 25, 2020

#1289 in Command line utilities

Download history 19/week @ 2023-10-29 4/week @ 2023-11-05 1/week @ 2023-11-12 4/week @ 2023-11-19 35/week @ 2023-11-26 25/week @ 2023-12-03 11/week @ 2023-12-17 22/week @ 2023-12-24 5/week @ 2023-12-31 11/week @ 2024-01-07 11/week @ 2024-01-14 11/week @ 2024-01-21 23/week @ 2024-01-28 2/week @ 2024-02-04 41/week @ 2024-02-11

82 downloads per month

MIT license

9KB
150 lines

mgit

Version License Downloads

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 git with all the arguments you passed to mgit.
  • 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).

Examples

Keeping your indices up-to-date:

$ mgit fetch

Keeping your code up to date (if no conflicts):

$ mgit pull --ff-only

Keeping your code up to date, rebasing and using autostash:

$ mgit pull --rebase --autostash

Output

Per (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

Roadmap / ideas

  • Use async.
  • Benchmark (and optimize?).

Changelog

0.1.10

  • Updated dependencies.

0.1.9

  • Increased default thread count.
  • Updated dependencies.

0.1.8

  • Updated dependencies.

0.1.7

  • Updated libc.

0.1.6

  • Updated walkdir dependency.

0.1.5

  • Add empty line at the end of the output.

0.1.4

  • Updated dependencies.

0.1.3

  • Output the amount of projects affected (and the command) up front.

0.1.2

  • Moved output collection into spawned thread to release file handles earlier.

0.1.1

  • Add a summary at the end of the output.

0.1.0

  • Initial working version.

License

MIT licensed

Dependencies

~240–485KB