从 cgit 克隆所有项目

Clone all projects from cgit

我必须下载某些 cgit 实例上托管的所有项目。有数百个存储库,因此手动执行此操作很繁琐。

如何做到?

似乎可以通过 curl 一页一页地解析页面来做到这一点。 by 有没有更方便的接口?

对于 CGit 到 export/clone 它的所有存储库,似乎没有任何官方或方便的 API。

你可以试试those alternatives:

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

或者:

curl -s http://git.suckless.org/ | xml pyx | awk ' == "Atitle" { print  }'

或者:

curl -s http://git.suckless.org/ | xml pyx | awk ' == "Atitle" { printf("git clone %s\n",) }' | s

我怀疑这项工作适用于 CGit 列出的 Git 个存储库的 一个 页:您可能仍然需要为 所有 个后续 Git 个存储库页面。