Created
June 20, 2015 15:07
-
-
Save markuman/d1f7b458026ae25e16f9 to your computer and use it in GitHub Desktop.
github2fossil
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
#!/bin/bash | |
USERNAME="markuman" | |
URL="https://api.github.com/users/${USERNAME}/repos"; | |
# ♥ pipes ♥ | |
curl -s "$URL" | grep '"url":' | grep -v '"https://api.github.com/users/markuman",'| sed s/,//g| sed s/\"//g| awk '{ print $2 }' | sed s/api.//g | sed s,/repos,,g > /tmp/list | |
while read p; do | |
git clone $p | |
NAME=$(basename "$p") | |
cd $NAME | |
git fast-export --all | fossil import --git ../$NAME.fossil | |
cd .. | |
done </tmp/list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment