2

My github project seems to be stuck on a large file that no longer exists on my operating system and i cannot push my commits since it keeps failing.

When I try to push my commits to the master branch on github, i get this error:

remote: Resolving deltas: 100% (1180/1180), completed with 13 local objects.
remote: error: GH001: Large files detected. You may want to try Git 
Large File Storage - https://git-lfs.github.com.
remote: error: Trace: e96e4de4bdf59aff52d77d7d2dde1b25
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File wheel/vendor/browscap/config/browscap.csv is 128.44 MB; this exceeds GitHub's file size limit of 100.00 MB

The problem is that the file is not in the directory.

I even installed the git large file support but its not tracking the file since its not on my computer

I've tried reloading the file with the commands:

root@yonaton-Lenovo-V570:/var/www/html/ssa# git checkout wheel/vendor/browscap/config/browscap.csv

root@yonaton-Lenovo-V570:/var/www/html/ssa# git reset wheel/vendor/browscap/config/browscap.csv

I don't know what to do at this point.

root@yonaton-Lenovo-V570:/var/www/html/ssa# git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch wheel/vendor/browscap/config/browscap.csv" HEAD
Cannot rewrite branches: You have unstaged changes.
Additionally, your index contains uncommitted changes.

root@yonaton-Lenovo-V570:/var/www/html/ssa# git filter-branch --tree-filter "rm -rf wheel/vendor/browscap/config/browscap.csv" HEAD
Cannot rewrite branches: You have unstaged changes.
Additionally, your index contains uncommitted changes.
somejkuser
  • 8,856
  • 20
  • 64
  • 130
  • 1
    If I'm understanding your question correctly, you're looking to remove the file from your git history (https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – Seth Rothschild Mar 10 '18 at 16:27
  • @SethRothschild Look at updates – somejkuser Mar 10 '18 at 16:34
  • Ah, you'll want to **stash** your changes before trying to filter (see [here](https://stackoverflow.com/questions/23517464/error-cannot-pull-with-rebase-you-have-unstaged-changes)). The error you're getting is saying that running the command will wreck your changes and is trying to prevent you from doing that. Stash lets you hide away your changes and then you can pop them back later. – Seth Rothschild Mar 10 '18 at 16:38
  • 2
    Possible duplicate of [How to remove/delete a large file from commit history in Git repository?](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – phd Mar 10 '18 at 18:32

1 Answers1

0

I had a similar issue and it turned out that the best way to tackle large files issues in git after you run the push command is to use git lfs migrate command:

git lfs migrate import --include="*.csv"

I found a solution here. The file-type for the large file was .zip for my case and the following command perfectly worked for me.

git lfs migrate import --include="*.zip" 
Abu Shoeb
  • 4,747
  • 2
  • 40
  • 45