Skip to content

Instantly share code, notes, and snippets.

@markuman
Created June 20, 2015 15:07
Show Gist options
  • Save markuman/d1f7b458026ae25e16f9 to your computer and use it in GitHub Desktop.
Save markuman/d1f7b458026ae25e16f9 to your computer and use it in GitHub Desktop.
github2fossil
#!/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