https://github.com/aelesbao/git-recursive
Execute git operations in multiple repositories
https://github.com/aelesbao/git-recursive
bash git tools
Last synced: 7 months ago
JSON representation
Execute git operations in multiple repositories
- Host: GitHub
- URL: https://github.com/aelesbao/git-recursive
- Owner: aelesbao
- License: mit
- Created: 2017-09-28T12:34:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-11T20:08:13.000Z (about 4 years ago)
- Last Synced: 2025-04-01T10:51:23.626Z (8 months ago)
- Topics: bash, git, tools
- Language: Shell
- Size: 36.1 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-recursive
An easy way to execute git operations in multiple repositories. Useful when you want to keep all your repos up-to-date.
Imagine you want to sync your local repositores and those are organised like this:
```
~/workspace
/repo-group-1
/repo1
/repo2
/repo3
/repo-group-2
/repo1
/repo2
```
Instead of going into each of them and doing a `git pull`, with git-recursive you can just execute:
```bash
git recursive repo-group-1 pull
```
## Installation
### Mac OS
```bash
brew install aelesbao/tools/git-recursive
```
### Building from source
Obtain the git-recursive source by cloning this repository or downloading a tarball of a [release](https://github.com/aelesbao/git-recursive/releases). Then install it by doing `make install` from the source tree.
```bash
git clone https://github.com/aelesbao/git-recursive.git
cd git-recursive
# checkout the latest tag
git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
[sudo] make install
```
By default, git-recursive is installed under `/usr/local`. To install it at an alternate location, specify a `PREFIX` when calling `make`.
```bash
make install PREFIX=$HOME/software
```
## Setup
git-recursive uses your `.gitconfig` file to store the path to a repository root, called `workspace`. To configure it, you should run:
```bash
git recursive add repo-group-1 ~/workspace/repo-group-1
```
> Mutiples workspaces are supported. Just add them as you want.
Any command issued on a workspace will be forwarded to its child repositories:
```bash
git recursive repo-group-1 status
```
To list the registered workspaces:
```bash
git recursive list
```
## Usage
```
usage: git recursive [] |( )
Available options are:
--no-color Do not colorize output
-h|--help Prints this message
-v|--version Prints the plugin version
Available subcommands are:
list Lists registered workspaces
add Adds or updates a workspace path
rm Removes a workspace
Running commands in a workspace:
Executes a git command on all repositories inside
the workspace
```
## License
**MIT License**
Copyright (c) 2021