A shell script to retrieve the public repos from a user in GitHub and sync them to a GitLab instance
It will retrieve and sync the following information for each public repo:
- all the branches
- all the tags
- latest 10 releases & assets (asset retention of latest 10 releases, can be disabled in
delete_asset
function) - wiki if available
GITHUB_TOKEN
: the user's GitHub token (to allow higher rate limit)GITLAB_URL
: the target GitLab instanceGITLAB_TOKEN
: the user's token in the target GitLab instanceSTORAGE_URL
: the dufs instance url
Install packages:
sudo apt install curl jq
Make file executable:
chmod a+x script.sh
Execute:
./script.sh "BitWarden" "418"
or clone specific repositories only:
./script.sh "BitWarden" "418" "server clients"