Execute a git command on multiple repositories
Add git-all
to your PATH
Note: git-all
depends on find
and will only work on Linux at this time.
When git-all
is on your PATH
, it can be called without the hyphen:
$ git all -h
usage: git-all [-h] [-d DEPTH] [-s] [-l] [-x] ...
positional arguments:
args git command to execute in each repo
optional arguments:
-h, --help show this help message and exit
-d DEPTH max search depth (used by the find command)
-s include submodules
-l list repos
-x allow pushing to repos (expert mode)
-
The default search depth is 6
-
The
-x
flag is required to use thepush
command
[hostname ~/devel]$ git all -d 2 status
[hostname ~/motor/modules]$ git all -s status
[hostname ~/motor/modules]$ git all -s fetch
[hostname ~/motor/modules]$ git all -s checkout master
[hostname ~/motor/modules]$ git all -s status
[hostname ~/synApps]$ git all fetch --unshallow
[hostname ~/synApps]$ git all config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
[hostname ~/synApps]$ git all fetch origin
Note: assemble_synApps.sh creates a shallow clone by default.