Git error, need to remove large file

前端 未结 8 754
北恋
北恋 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:54

    Adding to the previous answers:

    git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch path_to_the_file/your_big_file'
    

    Additionally, when I tried to pull I got "Refusing to merge unrelated histories".

    Solution was to use:

    git pull origin branch_name --allow-unrelated-histories
    

    Then solve your possible conflicts, and push this time without the big_file.

提交回复
热议问题