1GIT-OBLITERATE(1) Git Extras GIT-OBLITERATE(1)
2
3
4
6 git-obliterate - rewrite past commits to remove some files
7
9 git obliterate <files...> [-- <rev-list options...>]
10
12 Completely remove some files from the repository, including past com‐
13 mits and tags. WARNING! This command will rewrite the history similar
14 to git rebase(though it affects more). The rewritten history will have
15 different object names for all the objects and will not converge with
16 the original branch. So avoid using it on commits that you shared. And
17 it will mess up stash, so don´t have stash when you run git obliterate.
18
20 You can pass rev-list options to indicate the range of commits
21 affected. Those options need to be separated with ´--´ before them. Run
22 git help rev-list to see the acceptable options.
23
25 Remove .secret from the repository:
26
27
28
29 $ git obliterate .secret
30
31
32
33 Remove .secret from commits between origin and feature:
34
35
36
37 $ git obliterate .secret -- feature ^origin
38
39
40
41 Remove .secret from commit abcdefg to commit 1234567
42
43
44
45 $ git obliterate .secret -- abcdefg..1234567
46
47
48
50 Written by <brianloveswords@gmail.com>
51
53 <https://github.com/tj/git-extras/issues>
54
56 <https://github.com/tj/git-extras>
57
58
59
60 October 2017 GIT-OBLITERATE(1)