git之rm操作

从未push的最近一次commit中删除

使用git rm -cachedgit commimt amend -CHEAD命令

git rm --cached file     # 从缓存中删除,在disk中保留
git commimt amend -CHEAD # 修补上次commit

从较早的commit中删除

使用git filter-branch操作或者BFG Repo-Cleaner工具。
参考博客https://www.cnblogs.com/imzhizi/p/delete-files-thoroughly-using-bfg.html

https://help.github.com/en/github/managing-large-files/removing-files-from-a-repositorys-history
https://help.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository

posted @ 2020-02-23 16:27  骏腾  阅读(275)  评论(0编辑  收藏  举报