gotounix
V2EX  ›  问与答

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

  •  
  •   gotounix · Oct 31, 2014 · 9662 views
    This topic created in 4304 days ago, the information mentioned may be changed or developed.
    3 replies    2014-10-31 18:32:39 +08:00
    jwk345
        1
    jwk345  
       Oct 31, 2014
    先把该用户的 https://github.com/{name}?tab=repositories 这个页面里所有 repo-list-name 爬下来,在一个一个 clone
    aliuwr
        2
    aliuwr  
       Oct 31, 2014
    奇怪的需求。
    这样可以获取到所有 repo 的地址,然后再写个循环就好了。
    https://gist.github.com/CzBiX/aaa58138879d9dc705a4
    juicy
        3
    juicy  
       Oct 31, 2014
    受 @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(' ')
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3305 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:24 · PVG 19:24 · LAX 04:24 · JFK 07:24
    ♥ Do have faith in what you're doing.