Tool for mirroring/syncing git mirrors and git repos.
Original ideas & Copyright: https://launchpad.net/linaro-android-gerrit-support
- Mirror directory structure:
[mirror-root-dir]/[remote-url]/[project-path].git
[mirror-root-dir] |---- android.git.linaro.org | |---- device | | |---- common.git | | |---- ... | |---- platform |---- android.googlesource.com |---- github.com |---- manhthiep/ |---- CyanogenMod/ |---- Evervolv/
- Working directory structure:
[working-root-dir]/[project-path]
[android] |---- abi | |---- cpp | |---- .git |---- bionic |---- bootable |---- build |---- cts |---- dalvik |---- development |---- device | |---- common | |---- generic | |---- ... |---- external |---- ...
-
Clone commands:
- Clone working dirs/mirrors from manifest file:
gittig clone [--mirror] --manifest=\
- Clone working dirs/mirrors from URL:
gittig clone [--mirror] --url=\
- Clone from manifest file with project filters:
gittig clone [--mirror] --manifest=\ --project=\
- Clone from manifest with remote (name/URL) filters
gittig clone [--mirror] --manifest=\ --remote=\
- Clone from manifest with reference mirrors:
gittig clone [--mirror] --manifest=\ --reference=\
- Clone working dirs/mirrors from manifest file:
-
Sync commands:
- Sync working dirs & mirrors from local directory (default is current directory):
gittig sync [--local-dir=\]
- Sync working dirs & mirrors from local directory with project filters:
gittig sync --project=\ [--local-dir=\]
- Sync working dirs/mirrors from manifest file (map to local directory):
gittig sync [--mirror] --manifest=\
- Sync from manifest file with project filters:
gittig sync [--mirror] --manifest=\ --project=\
- Sync from manifest with remote filters:
gittig sync [--mirror] --manifest=\ --remote=\
- Sync from manifest with reference mirrors:
gittig sync [--mirror] --manifest=\ --reference=\
- Sync working dirs & mirrors from local directory (default is current directory):
-
Options:
--manifest=manifest-file Path to manifest file --url=project-url URL of git project --mirror Enable mirror cloning/syncing --local-dir=local-dir Working local directory (default is current directory) --config=config-file Path to config file (default is in current directory) --reference=local-mirror-dir Path to local mirror directory --project=project-local-path,project-name Project include filter string, mutiple string allow (separated by comma) --remote=remote-name,remote-url Remote include filter string, mutiple string allow (separated by comma) --ignore-project=project-local-path,project-name Project exclude filter string, mutiple string allow (separated by comma) --ignore-remote=remote-name,remote-url Remote exclude filter string, mutilple string allow (separated by comma) --dry-run Not actual run, only print verbose --debug Enable debug logging
-
Config file: [.gittig]
- Syntax
[CONFIG] $var = val [remote-url] # this is a comment $var = val src-path = [local-path | skip]
- See example .gittig in this directory
- Syntax
-
Manifest file
- Uses manifest file format of Google's repo tool
- See examples in example-manifests directory
- 2014/07/14
- Rename pygit.py to gittig ('tig' is 'git' in reverse, like mirroring).
- 2013/08/18:
- Update pygit.py
- Added script helpers for cloning & syncing
- 2012/09/24:
- Removed git-repo.py & git-mirror.py
- Tagged pygit.py - v1.1
- 2012/09/21:
- Added pygit.py - combined funtions of git-mirror.py and git-repo.py
- 2012/09/15:
- Initial commit
- git-mirror.py - v1.0
- git-repo.py - v1.0
- Added example manifests