LoginSignup
5
4

More than 5 years have passed since last update.

バカでかいgithubリポジトリをcheckoutしたい時

Last updated at Posted at 2015-02-28

git

$ git clone --depth 1 https://github.com/aozorabunko/aozorabunko.git
とかが失敗してcloneできない。

zip URL

Download Buddyなんかのダウンロードツールで、zipファイルのアドレス(https://github.com/aozorabunko/aozorabunko/archive/master.zip) をダウンロードしても、1GBを超えたあたりでまたゼロから再ダウンロード(!!!!)となる。

wgetでrange指定すれば、うまくいくかもしれない。(ダメかもしれない)

svn

SVNなら、checkoutが途中で失敗しても、失敗した時点の続きからcheckout処理を継続できる。

$ svn checkout https://github.com/aozorabunko/aozorabunko

失敗したら、svn cleanupして、またsvn checkoutすればよい。
何度も何度も失敗して面倒な場合は、whilesvn checkoutが成功するまでループさせられる。

$ cd aozorabunko

$ while ! (svn cleanup && svn checkout https://github.com/aozorabunko/aozorabunko .) ; do ; done

途中で止めたい場合、Ctrl-cでは止まらないので、Ctrl-zしてから$ kill %1する。

$ du -h -s aozorabunko/trunk
2.1G    aozorabunko/trunk

1GB以上のgitリポジトリはcheckoutが大変なので、subversionで運用しよう。

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4