Mirror git repositories between GitLab, GitHub and Bitbucket. No admin permissions required.
834
This tool mirrors repositories between GitLab, GitHub and Bitbucket. No direct access to the GitLab Server is required.
requirements.txtpip install -r requirements.txt
docker run --volume /path/to/config.json:/git-mirror/config.json \
temparus/git-mirror:latest --verbose
python3 /path/to/git-mirror/git-mirror.py --config /path/to/config.json
Cron
GIT_MIRROR_DAEMON.
version: "3"
services:
git-mirror:
image: temparus/git-mirror:latest
environment:
- GIT_MIRROR_DAEMON=0 * * * *
volumes:
- /path/to/config.json:/git-mirror/config.json
crontab -e and add the following line there
0 * * * * python3 /path/to/git-mirror/git-mirror.py --config /path/to/config.json
The default configuration file is ./config.json. It needs to have the following structure:
An example configuration file can be found in the file config.example.json.
hoster keysdomain: Only needed for type gitlaborganization: User namespace is used when this key is missing.task keyssync: Specify the repository type to to be synchonized.
Possible values: all, public, internal, private, manual (default: manual)create: Specify if non-existing repositories should be created at the destination
(default: true)delete: Specify if mirrored repositories missing on the source should be deleted
at the destination (default: false)repositories: An array of repository names to be synced
(regardless of the sync setting)usage: git-mirror.py [-h] [--verbose] [--config config.json] [--version]
Synchronizes repositories between GitLab and GitHub.
optional arguments:
-h, --help show this help message and exit
--verbose, -v prints more output to the console
--config config.json, -c config.json
path to the configuration file
--version show program's version number and exit
Copyright (C) 2018 Sandro Lutz <[email protected]>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Content type
Image
Digest
Size
28.9 MB
Last updated
over 4 years ago
docker pull temparus/git-mirror