0

I initialized a new repository in my current folder and committed to it. I created a remote on Github and tried to push to it.

 git push -u origin master

The push failed because I had a large 110 MB file sequence.fasta which was over Github's file size limit. I compressed the file and removed the earlier ref:_

 bz2 sequence.fasta     
 git rm sequence.fasta
 git addd sequence.fasta.bz2

and committed

 git commit -m "Compressed large file sequence.fasta"

Then I tried push again

 git push -u origin master

It gave the same error with file "sequence.fasta". I did git ls-tree -r master and it shows only sequence.fasta.bz2, not the oversized one. What is going wrong?

McDowells
  • 98
  • 5

2 Answers2

1

You still have the reference to the large file in your repo. You have the commit that added the file, so git will keep it in the history for checkout. You need to remove the references to this file.

You can do a git rebase -i <SHA before large file> and change the commit that added the file and replace it with your new one. Since the commits are only local changing history is not a bad thing.

Schleis
  • 41,516
  • 7
  • 68
  • 87
0

you need to remove it from all commits in your git history, not just create a commit without it, but leave it in previous commits. you can use the bfg for this: https://stackoverflow.com/a/17890278/2536029

Community
  • 1
  • 1
mnagel
  • 6,729
  • 4
  • 31
  • 66