Skip to content

Instantly share code, notes, and snippets.

@BinaryKitten
Created October 25, 2013 20:14
Show Gist options
  • Select an option

  • Save BinaryKitten/7161136 to your computer and use it in GitHub Desktop.

Select an option

Save BinaryKitten/7161136 to your computer and use it in GitHub Desktop.
for repo in $(cat repos-list.txt)
do
git clone user@host:/var/git/$repo
cd /d/repos/$repo
git remote add gitlab git@otherhost:group/$repo.git
git push gitlab master
for branch in $(git branch -r)
do
remote="${branch:0:6}"
bname="${branch:7}"
if [ $remote == "origin" ]
then
git checkout $branch -b $bname
git pull $remote $bname:$bname
git push gitlab $bname:$bname
fi
done
cd /d/repos
rm -rf /d/repos/$repo/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment