Prune binary data from a git repository after the fact

后端 未结 1 1853
花落未央
花落未央 2021-01-31 16:12

I accidentally committed some large binary data into some commits. Since then I\'ve updated my .gitignore, and those files are no longer being committed. But I\'d like to go bac

相关标签:
1条回答
  • The solution in this answer worked perfectly for me:

    You can also test your clean process with a tool like bfg repo cleaner, as in this answer:

    java -jar bfg.jar --delete-files *.{jpg,png,mp4,m4v,ogv,webm} ${bare-repo-dir};
    

    (Except BFG makes sure it doesn't delete anything in your latest commit, so you need to remove those files in the current index and make a "clean" commit. All other previous commits will be cleaned by BFG)

    0 讨论(0)
提交回复
热议问题