GIT-OBLITERATE(1)
π GIT-OBLITERATE(1) π
okay bestie, welcome to git-obliterate β it's from the Git Extras collection, and it is genuinely one of the most unhinged little commands in the whole box. buckle up. π
β¨ NAME β¨
git-obliterate β rewrite past commits to remove some files π«Ά
πΈ SYNOPSIS πΈ
git obliterate <files...> [-- <rev-list options...>]
π DESCRIPTION π
so like. you know how some file just needs to not exist anymore? not just "delete it going forward" β like, gone from the past too, from commits, from tags, from the whole timeline. that's what this does. it completely removes some files from the repository, including past commits and tags. no cap. π¦
WARNING! This command will rewrite the history similar togit rebase(though it affects more). The rewritten history will have different object names for all the objects and will not converge with the original branch. So avoid using it on commits that you shared. And it will mess up stash, so don't have stash when you rungit obliterate.
π let me say that again in group-chat form: every single object in your rewritten history gets a different object name, and it will never converge with the original branch. so if you already pushed those commits to other people? bestie. do not. π
and the stash thing β fr fr, do not have a stash when you run this. it will mess it up. clear your stash first, queen. β¨
π OPTIONS π
You can pass rev-list options to indicate the range of commits affected. Those options need to be separated with -- before them. Run git help rev-list to see the acceptable options.
<files...>β the files you want obliterated from history. raw. unfiltered. gone.-- <rev-list options...>β everything after the--is the range of commits you're affecting. remember the--, it's the lil barrier. π
π Examples π
Remove .secret from the repository:
$ git obliterate .secret
Remove .secret from commits between origin and feature:
$ git obliterate .secret -- feature ^origin
Remove .secret from commit abcdefg to commit 1234567
$ git obliterate .secret -- abcdefg..1234567
like look at those. three lines and a whole file stops existing across time. main character energy honestly. π₯
π AUTHOR π
Written by <brianloveswords@gmail.com> β ty for the obliteration tech, king π«Ά
π REPORTING BUG π
<https://github.com/tj/git-extras/issues> β go yell there if something's broken, not at me π
π SEE ALSO π
<https://github.com/tj/git-extras>
okay that's the whole page, you ate it, periodt. π this was Git Extras, version May 2026, and yeah the little footer says GIT-OBLITERATE(1) too β we been knew. now go forth and rewrite history responsibly (or don't, i'm not your mom). π§β¨
π¦ where this page comes from
- ubuntu stonking: git-extras 7.5.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms