Tool to handle several packages within a workspace
- Python 2.7 or newer
- Git 1.7 or newer
- Pip 1.5 or newer
$> pip install -r ./requirements.txt
Create a copy from the templated config
$> cp config/environment.yml.dist config/environment.yml
and edit it with your preferences
$ vim config/environment.yml
version: 0.1
prod_branch: origin/master
remote.default: origin
n_cpu: False
where:
- n_cpu: Number of cpu assigned to the mgit
- prod_branch: What it is consider your production branch
- remote.default: Git remote
$> ln -snf $(pwd)/main.py /usr/local/bin/mgit
mgit
is meant to be use to handle multirepo project, so to use it you have to place yourself within one folder in which contains several repositories such us:
➜ mymultiproject tree
.
├── repository-1
├── repository-2
└── repository-3
then you can use regular git command across:
- every repository (`--all)
- repository only with local changes (`--only-local)
- repository in no prod branch (`--no-prod)
Running pull over all repos you can run:
$> mgit pull --all
Create a new branch for every project with changes using:
$> mgit checkout -b new_branch --only-local
Commit changes on not repos using not prod branch
$> mgit commit -a -m "My commit message" --no-prod
$ mgit -h
usage: mgit [-h] [--ws [WS]] [--version] [--only-local] [--all] [--no-prod]
[--packages PACKAGES [PACKAGES ...]]
{log,diff,status,pull,push,commit,checkout,clean,bash,reset,merge}