The idea here is to mirror the repository using crontab every minute.
- As you all know about Free Gitlab Mirror Support Ended on March 22 for external Repositories.
- Now in new premium update gitlab had stopped the mirroring of external repository making it's a premium feature, so this is a replication of that feature.
Just make sure you have self hosted server or local linux environment.
Also make sure you have Github and Gitlab ssh installed.
* * * * * sh /path/to/mirror.sh >/dev/null 2>&1
- Edit mirror.php and set appropriate git ssh config for repository on line number 19 and 22
- The public ssh key of www-data should have read and write access to source repository.
- If the SSH server is not trusted the connection will fail.
- To avoid non trusted connection to server, run
ssh -T [email protected]
andssh -T [email protected]
at least once to get its fingerprint into the local SSH configuration or hosted server ssh configuration.
- More info on duplicating the repository Duplicating Repository
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.