Skip to content

Instantly share code, notes, and snippets.

@dianariyanto
Created February 17, 2022 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dianariyanto/9b4e73ddfab460beaa9acb3c1dcf70de to your computer and use it in GitHub Desktop.
Save dianariyanto/9b4e73ddfab460beaa9acb3c1dcf70de to your computer and use it in GitHub Desktop.
Repo mirroring from gitlab to github
#!/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