1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitLFSで大量のデータから一部分取得する

Posted at

Gitでバイナリデータを扱う際にはGitLFSを使用するのが一般的かと思われる。
ただ、GitLFSを利用して大量のデータを扱ってしまうとgit lfs cloneするのにものすごく時間がかかってしまう。。。

なので、ディレクトリの一部分だけ取得したい場合とかのためにgitのコマンドをメモしておく

mkdir <workspace>
cd <workspace>
git init
git config core.sparsecheckout true
git config filter.lfs.smudge "git-lfs smudge --skip %f"
git remote add origin <URL>
echo "取得対象のリポジトリ内のディレクトリを指定 (e.g./tmp)" > .git/info/sparse-checkout
git pull origin master 
git lfs pull -I 対象のファイルパス(カンマ区切りで複数指定できる)
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?