Skip to content

Instantly share code, notes, and snippets.

@mikewest
Created October 11, 2010 17:57
Show Gist options
  • Save mikewest/620949 to your computer and use it in GitHub Desktop.
Save mikewest/620949 to your computer and use it in GitHub Desktop.
"Oneliner" to backup your public github repos.
#!/bin/sh
# Run from a directory in which you'd like to shove a _lot_ of bare repositories.
curl -s http://github.com/api/v2/yaml/repos/show/mikewest | grep ':url:' | awk '{ print $2 }' | sed -e 's#http://#git://#' -e 's#$#.git#' | xargs -L 1 git clone --bare
@mikewest
Copy link
Author

aolcm: You're right. You can do everything with a single sed command. :)

I find it pretty hard to follow, though... using smaller steps makes the whole process a bit clearer to me; I know exactly what each command is doing and can follow the interactions. I think your solution, though surely functional, is simply less readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment