V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
gotounix
V2EX  ›  问与答

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

  •  
  •   gotounix · 2014-10-31 17:06:28 +08:00 · 9233 次点击
    这是一个创建于 3501 天前的主题,其中的信息可能已经有所发展或是发生改变。
    3 条回复    2014-10-31 18:32:39 +08:00
    jamesxu
        1
    jamesxu  
       2014-10-31 17:42:01 +08:00
    先把该用户的 https://github.com/{name}?tab=repositories 这个页面里所有 repo-list-name 爬下来,在一个一个 clone
    aliuwr
        2
    aliuwr  
       2014-10-31 18:01:37 +08:00
    奇怪的需求。
    这样可以获取到所有 repo 的地址,然后再写个循环就好了。
    https://gist.github.com/CzBiX/aaa58138879d9dc705a4
    juicy
        3
    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(' ')
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1330 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 17:53 · PVG 01:53 · LAX 10:53 · JFK 13:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.