aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: de5cd106e75cd7c9ac0ea99ea8aa1c02d9bc7604 (plain) (blame)
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
43
44
45
46
47
[![TravisCI Build Status](https://travis-ci.org/mlocati/incremental-git-filter-branch.svg?branch=master)](https://travis-ci.org/mlocati/incremental-git-filter-branch)

## Introduction

[`git filter-branch`](https://git-scm.com/docs/git-filter-branch) is a really nice git feature.
For instance, it allows fancy stuff like subtree-splitting.

Problems may arise when the repository contains a lot of commits: this operation can take a lot of time.

Luckily recent versions of git allow us to perform this operation in an incremental way:
the first time `filter-branch` still requires some time, but following calls can be very fast.


## Requirements

- git 2.5.0 or newer
- common commands (`sed`, `grep`, `md5sum`, `cut`, ...)


## Usage

Get the script and read the syntax using the `--help` option.


## Examples

```sh
./incremental-git-filterbranch.sh \
    --branch-whitelist 'develop master rx:release\/.*' \
    --tags-plan all --tags-max-history-lookup 10 \
    https://github.com/concrete5/concrete5.git \
    '--prune-empty --subdirectory-filter concrete' \
    git@github.com:concrete5/concrete5-core.git
```


## Legal stuff

Use at your own risk.
[MIT License](https://github.com/mlocati/incremental-git-filter-branch/blob/master/LICENSE).


## Credits

Special thanks to [Ian Campbell](https://github.com/ijc) for the implementation of the `--state-branch` option of git,
and his hints about how it can be used.
This script works only thanks to him (and if it doesn't work I'm the only person to blame).

© 2014-2020 Faster IT GmbH | imprint | privacy policy