git shallow clone
概要
普通にcloneした時はリポジトリまるごと(すべてのコミット履歴あり)取得してくる
最新版だけ取得できれば良くて、過去の更新履歴がいらないという場合にshallow cloneを使用する
コミットが多くてcloneに時間がかかるようなリポジトリでもすぐに取得できる
コマンド
最新の状態だけを取得する
git clone --depth 1 https://github.com/git/git
直近の2コミットを取得
git clone --depth 2 https://github.com/git/git
shallow cloneを普通のcloneにする
git fetch --unshallow