Skip to content

Instantly share code, notes, and snippets.

@joshghent

joshghent/mirror.sh

Created Aug 21, 2019
Embed
What would you like to do?
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
You can’t perform that action at this time.