[{"data":1,"prerenderedAt":23},["ShallowReactive",2],{"post-git-repos-heavy":3},{"_id":4,"_path":5,"title":6,"description":7,"date":8,"heroImagePath":9,"tagArr":10,"relatedPost":14,"categoryArr":18,"preface":19,"body":20,"htmlContent":21,"excerptHtml":22},"content:post:git-repos-heavy.md","/post/git-repos-heavy/","Gitで重いリポジトリをcloneするとき","","2015-11-18T13:45:00+09:00",null,[11,12,13],"word-press","git","source-tree",[15,16,17],"tech-book-fest-18-chat-ai","tech-2025-08-08-gpt-5","markdown-url-link",[],"本記事は\u003Ca href=\"https://qiita.com/butchi_y/items/cc0fe50acc47c1e3ab32\">Qiita\u003C/a>から引っ越しました。","\n# Gitで重いリポジトリをcloneするとき\n\nWordPressの中規模サイトをGitで管理していて、\nファイル容量を圧迫していたので一旦削除したのですが、\n今回また修正の必要が出てきてSourceTreeでクローンしようとしたら、\n\n```\ngit -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin\nremote: warning: suboptimal pack - out of memory\nerror: pack-objects died of signal 9\nerror: git upload-pack: git-pack-objects died with error.\nfatal: git upload-pack: aborting due to possible repository corruption on the remote side.\nremote: aborting due to possible repository corruption on the remote side.\nfatal: protocol error: bad pack header\nCompleted with errors, see above\n```\n\nと行き詰まってしまいました。\n\nこんなときは多分SourceTreeではどうにもならず、\n\n\u003C!--more-->\n\n```\ngit clone --depth 1 http://example.com/fuga.git\ngit fetch --depth 10\ngit fetch --depth 100 # 値は調整しつつ\ngit fetch --unshallow # 最後に全部落とす このオプションは最新のgitでないとない\n```\n\nとやっていくことで完全に落とせました。\n今回はdepthを100から50〜100刻みで調整して、500ぐらいまで上げたら\nunshallowが成功しました。\nクローンしたGitリポジトリの容量を調べたら約10GBありました。\n重いー。\n\nこちらの記事を元に補足しました。\n[gitで重いリポジトリをcloneするとき - webネタ](https://r-h.hatenablog.com/entry/2013/12/07/093423)\n","\u003Ch1>Gitで重いリポジトリをcloneするとき\u003C/h1>\n\u003Cp>WordPressの中規模サイトをGitで管理していて、\nファイル容量を圧迫していたので一旦削除したのですが、\n今回また修正の必要が出てきてSourceTreeでクローンしようとしたら、\u003C/p>\n\u003Cpre>\u003Ccode>git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin\nremote: warning: suboptimal pack - out of memory\nerror: pack-objects died of signal 9\nerror: git upload-pack: git-pack-objects died with error.\nfatal: git upload-pack: aborting due to possible repository corruption on the remote side.\nremote: aborting due to possible repository corruption on the remote side.\nfatal: protocol error: bad pack header\nCompleted with errors, see above\n\u003C/code>\u003C/pre>\n\u003Cp>と行き詰まってしまいました。\u003C/p>\n\u003Cp>こんなときは多分SourceTreeではどうにもならず、\u003C/p>\n\n\u003Cpre>\u003Ccode>git clone --depth 1 http://example.com/fuga.git\ngit fetch --depth 10\ngit fetch --depth 100 # 値は調整しつつ\ngit fetch --unshallow # 最後に全部落とす このオプションは最新のgitでないとない\n\u003C/code>\u003C/pre>\n\u003Cp>とやっていくことで完全に落とせました。\n今回はdepthを100から50〜100刻みで調整して、500ぐらいまで上げたら\nunshallowが成功しました。\nクローンしたGitリポジトリの容量を調べたら約10GBありました。\n重いー。\u003C/p>\n\u003Cp>こちらの記事を元に補足しました。\n\u003Ca href=\"https://r-h.hatenablog.com/entry/2013/12/07/093423\">gitで重いリポジトリをcloneするとき - webネタ\u003C/a>\u003C/p>","\u003Ch1>Gitで重いリポジトリをcloneするとき\u003C/h1>\n\u003Cp>WordPressの中規模サイトをGitで管理していて、\nファイル容量を圧迫していたので一旦削除したのですが、\n今回また修正の必要が出てきてSourceTreeでクローンしようとしたら、\u003C/p>\n\u003Cpre>\u003Ccode>git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin\nremote: warning: suboptimal pack - out of memory\nerror: pack-objects died of signal 9\nerror: git upload-pack: git-pack-objects died with error.\nfatal: git upload-pack: aborting due to possible repository corruption on the remote side.\nremote: aborting due to possible repository corruption on the remote side.\nfatal: protocol error: bad pack header\nCompleted with errors, see above\n\u003C/code>\u003C/pre>\n\u003Cp>と行き詰まってしまいました。\u003C/p>\n\u003Cp>こんなときは多分SourceTreeではどうにもならず、\u003C/p>",1768521432881]