/parallel-git-repo

Run command on git repositories in parallel

Primary LanguageGoMIT LicenseMIT

parallel-git-repo

Run command on git repositories in parallel.

Installation

Binaries

Go style

go install github.com/jcgay/parallel-git-repo@latest

Configuration

Configure the repositories list where command will be run in $HOME/.parallel-git-repositories:

[repositories]
  default = [
    "/Users/jcgay/dev/maven-notifier",
    "/Users/jcgay/dev/maven-color"
  ]

The group default is mandatory.

You can create groups of repositories to separate them by concern:

[repositories]
  default = [
    "/Users/jcgay/dev/maven-color",
    "/Users/jcgay/dev/buildplan-maven-plugin"
  ]
  notifier = [
    "/Users/jcgay/dev/maven-notifier",
    "/Users/jcgay/dev/gradle-notifier"
  ]

Also define commands that you want to run on these repositories:

[commands]
  fetch = "git fetch -p"
  status = "git status"
  pull = "git pull"
  push = "git push $@"
  checkout = "git checkout $@"
  current-branch = "git rev-parse --abbrev-ref HEAD"
  merge = "git merge --log --no-ff $@"
  set-version = "mvn versions:set -DnewVersion=$1"
  ismerged = "git branch --list $1 -r --merged"
  contains = "git branch -r --contains $1"

This is a TOML file.

Usage

List available commands:

parallel-git-repo -h

Example when running pull command:

$> parallel-git-repo pull
maven-color: ✔
maven-notifier: ✔

Run an arbitrary command:

parallel-git-repo run git remote -v

Run command for a specific group

parallel-git-repo -g=notifier status

Build

Status

Build Status Code Report Coverage Status

Release

make release

List available tasks

make help