← 返回命令列表

Linux command

git-obliterate 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Remove file from entire history

git obliterate [filename]

说明

git obliterate completely removes a file from the entire Git history. This git-extras command rewrites every commit to erase all traces of the specified file, as if it had never been added to the repository. The operation is useful for removing accidentally committed secrets, sensitive data, or large files that should never have been tracked. It is a convenience wrapper around `git filter-branch` or `git filter-repo`, handling the complexity of full history rewriting. After obliteration, the repository is repacked to reclaim disk space.

FAQ

What is the git-obliterate command used for?

git obliterate completely removes a file from the entire Git history. This git-extras command rewrites every commit to erase all traces of the specified file, as if it had never been added to the repository. The operation is useful for removing accidentally committed secrets, sensitive data, or large files that should never have been tracked. It is a convenience wrapper around `git filter-branch` or `git filter-repo`, handling the complexity of full history rewriting. After obliteration, the repository is repacked to reclaim disk space.

How do I run a basic git-obliterate example?

Run `git obliterate [filename]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.