- Notifications
You must be signed in to change notification settings - Fork1
Github to Gitlab Mirror the repository in php using crontab every minute.
License
DeepLinkCode/GithubToGitlab
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The idea here is to mirror the repository using crontab every minute.
- As you all know aboutFree 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 apremium 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/null2>&1
Edit mirror.php and set appropriate git ssh config for repository on line number 19 and 22
Now everything is in place, but because gitlab keeps it's own "special" branches in place, you might get these kinds of errors:
! [remote rejected] refs/keep-around/09c68d4f76f68041438040e3bb4316d5ca1d5135 -> refs/keep-around/09c68d4f76f68041438040e3bb4316d5ca1d5135 (deny updating a hidden ref)
We need to filter those out of the branches wedo want to mirror. In order to do that we edit the
config
file again.We should replace
fetch = +refs/*:refs/*
which basically says, everything, and just selecttags
,branches
andhead
[remote"mirror"] url = git@gitlab.external:reponame.git push = +refs/heads/*:refs/heads/* push = +refs/tags/*:refs/tags/* mirror =true
- 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 git@gitlab.com
andssh -T git@github.com
at least once to get its fingerprint into the local SSH configuration or hosted server ssh configuration.
- More info on duplicating the repositoryDuplicating Repository
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
About
Github to Gitlab Mirror the repository in php using crontab every minute.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.