Skip to content

Instantly share code, notes, and snippets.

@willis7
Created October 17, 2019 08:21
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 willis7/a721d924ef25674a9b38245f45f1d32b to your computer and use it in GitHub Desktop.
Save willis7/a721d924ef25674a9b38245f45f1d32b to your computer and use it in GitHub Desktop.
Mass migrating repositories to GitLab
for repo in $(cat repos.txt);
do git clone $repo --mirror;
slug=$(echo $repo | sed -n 's/.*\/\(.*\).git/\1/p');
cd $slug.git;
git remote add your_remote git@gitlab.com:your_organization/your_project/$slug.git;
git push your_remote --mirror;
cd -;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment