Как удалить ошибочно зафиксированные большие файлы из истории коммитов?Git больше не будет выдвигать коммиты на удаленный сервер, пока я не удалю проблемные файлы.С тех пор я пытался удалить их, но они существуют в предыдущих коммитах.
Примечание : мне больше не нужны большие файлы в проекте.
Вкл. git push origin my-branch
Я получаю:
remote: warning: File public/images/reserve_assets/myfile.tif is 63.60 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 0c08ce8916353c82c7328a241a40c8ca
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File public/images/reserve_assets/myotherfile.tif is 107.34 MB; this exceeds GitHub's file size limit of 100.00 MB
Затем
! [remote rejected] my-branch -> my-branch (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:RepoOwner/myrepo.git'
Я пробовал git filter-branch --tree-filter 'rm -f myfile.tif' HEAD
, который выполняет перезаписи в истории фиксации.Он выводит
Rewrite 1cd9b031d047d4270ff8b488b3b5e8db2905c687 (87/93) (12 seconds passed, remaining 0 predicted)
Но затем говорит WARNING: Ref 'refs/heads/my-branch' is unchanged
.Кажется, что он переписывает и удаляет из истории, но я все еще не могу нажать.