怎么快速的把 github 上某人的所有项目给 clone 到本地?

2014-10-31 17:06:28 +08:00
 gotounix
9237 次点击
所在节点    问与答
3 条回复
jamesxu
2014-10-31 17:42:01 +08:00
先把该用户的 https://github.com/{name}?tab=repositories 这个页面里所有 repo-list-name 爬下来,在一个一个 clone
aliuwr
2014-10-31 18:01:37 +08:00
奇怪的需求。
这样可以获取到所有 repo 的地址,然后再写个循环就好了。
https://gist.github.com/CzBiX/aaa58138879d9dc705a4
juicy
2014-10-31 18:32:39 +08:00
受 @aliuwr 启发,在他的答案上加了一句,这样一个指令就够了

https://gist.github.com/melon/9c2fd88c6705daeecdab


本来是希望从解析网页内容来得到地址的

[].slice.call(document.querySelectorAll('.repo-list-name a')).map(function(e){return document.location.origin+document.location.pathname+'/'+e.text.trim()+'.git';}).join(' ')

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/142995

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX