0

I tried to upload a file larger than 100 mb and github denied me. Since then I removed it from my local repo, performed again the usual git add - commit - push ritual, but I keep getting this output

Counting objects: 127, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (124/124), done.
Writing objects: 100% (127/127), 108.16 MiB | 3.95 MiB/s, done.
Total 127 (delta 12), reused 1 (delta 0)
remote: Resolving deltas: 100% (12/12), done.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: TRACENUMBER
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File data/myfile.csv is 678.14 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/REPO_URL
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/REPO_URL'

as if the file is still in my local repo. git status says:

On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

but of course I cannot push anything. For information the repository is private, I can push (and I always did) but I'm not the owner.

sato
  • 768
  • 1
  • 9
  • 30
  • 1
    It seems you haven't deleted it locally. Or rather, you probably created a second commit that deletes the file, but the first one, adding the file, is still there in your repo. You need to rebase to make it disappear from your first commit. – JB Nizet Dec 10 '18 at 18:57

1 Answers1

0

You might have removed it from your repo, but the file is still (clearly) hiding in some commit you're trying to push. git rm will not do the trick here: you have to rebase (or merge --squash into a new branch) in order to get rid of the commits that contain that file.

Matt Messersmith
  • 12,939
  • 6
  • 51
  • 52