Skip to content

Instantly share code, notes, and snippets.

@joshghent
Created August 21, 2019 08:25
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 joshghent/d64f73267d43983e62c4d34d646e7969 to your computer and use it in GitHub Desktop.
Save joshghent/d64f73267d43983e62c4d34d646e7969 to your computer and use it in GitHub Desktop.
Mirror repos from gitlab to github
#!/bin/bash
repos=(repository1 repository2)
githubName="joshghent"
for repo in "${!repos[@]}"
do
reponame=${repos[repo]}
git clone git@gitlab.com:${githubName}/${reponame}.git
cd ${reponame}
git remote add github git@github.com:${githubName}/${reponame}.git
git push --mirror github
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment