3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

100MB を超えるファイルをプッシュするにはGit LFS を使用する

Posted at

はじめに

Gitに作成したアプリをプッシュしようとしたところ、下記のエラーが出ました。
ファイルの容量が大きすぎたようです。

Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.

Git Large File Storage (LFS) を使ってみる

インストール(Ubuntu)

sudo apt-get install git-lfs

対象リポジトリ下で初期化

git lfs install

対象ファイル(要領の大きいファイル)をLFSに追加

git lfs track "対象ファイル"

.gitattributes ファイルをコミット

git add .gitattributes
git commit -m "Track large files with Git LFS"

対象ファイルをコミット

git add .{LFSに追加した対象ファイル}
git commit -m "Add large files"

プッシュ

git push

おわりに

Git上で管理をする必要のないファイルなのであれば、.gitignoreに追記して追跡対象外にしましょう。
また、コミット・プッシュはこまめに行いましょう・・

参考

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?