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

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

  •  
  •   gotounix · 2014 年 10 月 31 日 · 9507 次点击
    这是一个创建于 4105 天前的主题,其中的信息可能已经有所发展或是发生改变。
    3 条回复    2014-10-31 18:32:39 +08:00
    jwk345
        1
    jwk345  
       2014 年 10 月 31 日
    先把该用户的 https://github.com/{name}?tab=repositories 这个页面里所有 repo-list-name 爬下来,在一个一个 clone
    aliuwr
        2
    aliuwr  
       2014 年 10 月 31 日
    奇怪的需求。
    这样可以获取到所有 repo 的地址,然后再写个循环就好了。
    https://gist.github.com/CzBiX/aaa58138879d9dc705a4
    juicy
        3
    juicy  
       2014 年 10 月 31 日
    受 @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   ·   Solana   ·   942 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 21:50 · PVG 05:50 · LAX 13:50 · JFK 16:50
    ♥ Do have faith in what you're doing.