silly me...
so i as blindly adding files to git with git add .
, not realising that there were some stupidly large tarballs in the path. and of course not having the relevant .gitignore
in place.
of course, i didn't think too much of it, and didn't run a git status
before committing it... and then some other commits too.
so...
$ git ls-files | xargs ls -l | sort -nrk5 | head -n 10
-rw-r--r-- 1 ytl sf 3046648860 Oct 18 2018 images/rosetta/rosetta_src_3.10_bundle.tgz
-rw-r--r-- 1 ytl sf 160017409 May 15 14:32 images/chimera/1.13.1/chimera-1.13.1-linux_x86_64.bin
-rw-r--r-- 1 ytl sf 4768999 Oct 16 2018 images/protomo/deplibs.tar.bz2
-rwxrwxr-x 1 ytl sf 2662328 Apr 24 2019 images/motioncor2/1.2.3-intpix/MotionCor2
and
$ git log --pretty="%h - %s"
cbc481c - remove large files
0b3e0d8 - add checks
f318f18 - modify cluster
f44838c - lots of changes...
ac7d198 - pick up parent bin.files
ac7d198
is just before my stupidness. cbc481c
contains me trying to do git rm --cached <files>
. of course, when i do a push, it will still try to put the files into git...
so... i know that if i just do a git checkout
, it will basically remove the files from the file system that were added after that checkout.
so my question is how can i revert everything back to ac7d198
without loosing any data? or even better, how can i just remove just the large files from the commit?