0

I'm trying to push my commits but the remote returns error as:

Counting objects: 11277, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (4759/4759), done.

Writing objects: 100% (11277/11277), 76.66 MiB | 0 bytes/s, done.

Total 11277 (delta 7512), reused 9645 (delta 6340)

remote: warning: Large files detected.

remote: error: File 
"DreaMove/main/Classes/ChatVC/\344\272\262\345\212\240/libgotyeapi_c++11.a" is 134.87 MB; this exceeds Git@OSC's file size limit of 100 MB

remote: error: hook declined to update refs/heads/master

To https://git.oschina.net/maxLoveCode/Yuepai.git

 ! [remote rejected] master -> master (hook declined)

error: failed to push some refs to 'https://git.oschina.net/maxLoveCode/Yuepai.git'

The libgotyeapi_c++11.a is more than 100MB, but I have tried both

git rm libgotyeapi_c++11.a

and

git rm --cache libgotyeapi_c++11.a

but I still cannot push the code by push -f command

I have also tried the command like

git filter-branch -f --index-filter'git rm --cached --ignore-unmatch DreaMove/main/Classes/ChatVC/\344\272\262\345\212\240/libgotyeapi_c++11.a' 

To rewrite the commit histories, but it still doesn't work. Please help I've been at this for hours!

Mix
  • 459
  • 1
  • 7
  • 20
  • 2
    possible duplicate of [How to remove/delete a large file from commit history in Git repository?](http://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – Zloj Sep 22 '15 at 09:25
  • @Zloj Thank you, it works. – Mix Sep 23 '15 at 01:42

1 Answers1

1

I used git rebase -i to clean the git history.

According to the link posted by Zloj in the comment.

Although the large file was removed from the current commit, it has appeared in the history commits. And the git hook in the remote detected that file then rejected the force push.

Check the highest up-voted answer in How to remove/delete a large file from commit history in Git repository?

But please remember to BACKUP your works before any prune action to your history commits!

Community
  • 1
  • 1
Mix
  • 459
  • 1
  • 7
  • 20