File: git-obliterate.md

package info (click to toggle)
git-extras 7.4.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 2,120 kB
  • sloc: sh: 4,312; python: 994; makefile: 146
file content (42 lines) | stat: -rw-r--r-- 1,306 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
git-obliterate(1) -- rewrite past commits to remove some files
===============================

## SYNOPSIS

git obliterate <files...> [-- <rev-list options...>]

## DESCRIPTION

Completely remove some files from the repository, including past commits and tags. 
WARNING! This command will rewrite the history similar to `git 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 run `git obliterate`**.

## 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.

## 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

## AUTHOR

Written by &lt;<brianloveswords@gmail.com>&gt;

## REPORTING BUG

&lt;<https://github.com/tj/git-extras/issues>&gt;

## SEE ALSO

&lt;<https://github.com/tj/git-extras>&gt;