Skip to content

Instantly share code, notes, and snippets.

@joshghent
Created August 21, 2019 08:25
Show Gist options
  • 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 [email protected]:${githubName}/${reponame}.git
cd ${reponame}
git remote add github [email protected]:${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