My git push is stuck in a big file. What to do?

I get the fatal error sha1. I believe that he was stuck trying to write large files. My status says I'm on the eighth day in advance. I tried adding the file extension to the ignore list in the exclude folder, but it was still stuck. How can I continue without losing local changes (except for large files)?

I tried to Predict how much data will be pressed in git push , and the package is ~ 650 MB.

I do not know how to ignore files from previous commits that were not pushed. Can I delete old commits without losing local files? Then delete the large files and re-attach?

+7
git
source share
1 answer

From http://git-scm.com/book/en/Git-Tools-Rewriting-History :

Delete a file from each commit

This happens quite often. Someone accidentally commits a huge binary with mindless git add., And you want to delete it everywhere. Perhaps you accidentally took a file containing a password and want to make your project open source. filter-branch is a tool that you probably want to use to clear your entire history. To remove a file called passwords.txt from your entire history, you can use the -tree-filter option to filter the branch:

$ git filter-branch --tree-filter 'rm -f passwords.txt' HEAD

But if it is only the last one to commit you, you can solve it with git rm large_file and git commit --amend

+9
source share

All Articles