gotounix
V2EX  ›  问与答

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

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