Created
February 17, 2022 17:50
-
-
Save dianariyanto/9b4e73ddfab460beaa9acb3c1dcf70de to your computer and use it in GitHub Desktop.
Repo mirroring from gitlab to github
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://www.shellcheck.net/ | |
#!/bin/bash | |
read -p "Enter GitLab repo URL : " repo | |
read -p "Enter GitHub repo URL : " newrepo | |
IFS='/' | |
read -a array <<< "$repo" | |
reponame=${array[1]} | |
git clone --bare $repo | |
cd $reponame | |
echo $reponame | |
git push --mirror $newrepo | |
cd .. | |
rm -rf $repo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment