Created
October 25, 2013 20:14
-
-
Save BinaryKitten/7161136 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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