Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find and remove too large of files to push in git lfs

Tags:

git

git-lfs

I have a commit, and I am trying to push it. I get this response

Git LFS: (0 of 9 files, 9 skipped) 0 B / 3.24 GB, 3.24 GB skipped
[422] Size must be less than 2147483648
[0ee4f2bc4d42d98ea0e7b5aeba2762c7482f3bcf00739d40b922babe8061820b] Size must be less than 2147483648
error: failed to push some refs to ...

What files are these?

How can I find and remove them from my commit so I can push all these files up?

like image 397
Trey Avatar asked Jun 01 '16 18:06

Trey


1 Answers

A simple

git ls-files

will give you a listing of files currently managed by git.

With a bit of pipe magic, the file over size limit get's pretty easy to spot

git ls-files -z | xargs -0 stat -c '%s %n' | sort -n 

will give you an ascendingly sorted list of file sizes and corresponding files.

like image 71
Marcus Müller Avatar answered Oct 10 '22 16:10

Marcus Müller