Git error, need to remove large file

前端 未结 8 629
北恋
北恋 2021-02-01 05:37

I am getting this error when I try to push to git and I have no idea how to fix it.

Counting objects: 1239, done.
Delta compression using up to 4 threads.
Compre         


        
8条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 05:58

    Adding to the previous answers:

    We are going to remove the large file from the commit as you said

    1. Do the push from the terminal just to get the large file path git push --set-upstream origin Remote_branch_name, locate the large file path in the errors, something like RepositoryName/folders.../bigFileName.

    2. Remove the file from all the branches, git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch path_and_big_file' past the path that we found in section one instead of path_and_big_file.

    3. Execute git pull origin branch_name --allow-unrelated-histories to not get unrelated histories error

    4. Now try to push to git, it should work

提交回复
热议问题