How to permanently delete a commit from Git's history?

前端 未结 5 1976
甜味超标
甜味超标 2021-02-04 16:02

How can I permanently delete a commit from Git\'s history?

One of the developers on the team has accidentally committed a 200 MB file and pushed it to our Git server. It

5条回答
  •  遥遥无期
    2021-02-04 16:51

    You can use git filter-branch. Please note that this involves history rewrite, and all clones need to be recreated. You can find a good introduction to the topic in the Pro Git book.

提交回复
热议问题