Cloning cgit repositories

Published: Sunday, Dec 9, 2012 Last modified: Monday, Apr 8, 2024

For example to clone all repositories upon http://git.suckless.org/, which uses the cgit frontend:

curl -s http://git.suckless.org/ |
xml sel -N x="http://www.w3.org/1999/xhtml" -t -m "//x:a" -v '@title' -n |
grep . |
while read repo
do git clone git://git.suckless.org/$repo
done

Alternatively:

15:24 <c00kiemon5ter> curl -s http://git.suckless.org/ | xml pyx | awk '$1 == "Atitle" { print $2 }'
15:26 <c00kiemon5ter> funnier: curl -s http://git.suckless.org/ | xml pyx | awk '$1 == "Atitle" { printf("git clone %s\n",$2) }' | sh