An open API service indexing awesome lists of open source software.

https://github.com/fortio/delta

Diff 2 sets and apply command to deltas
https://github.com/fortio/delta

Last synced: 4 months ago
JSON representation

Diff 2 sets and apply command to deltas

Awesome Lists containing this project

README

          

[![codecov](https://codecov.io/github/fortio/delta/branch/main/graph/badge.svg?token=LONYZDFQ7C)](https://codecov.io/github/fortio/delta)

# Delta
Diff 2 sets and apply command to deltas

## Installation

If you have golang, easiest install is (will also be the smallest binary thanks to build tags and other arguments)
```bash
CGO_ENABLED=0 go install -tags no_json,no_net -trimpath -ldflags "-w -s" github.com/fortio/delta@latest
```

Or brew custom tap
```
brew install fortio/tap/delta
```

Otherwise head over to https://github.com/fortio/delta/releases for binary releases

## Usage

delta -b "echo NEW:" -a "echo REMOVED:" oldFile newFile

if `oldFile` is
```
old1
old2
gone1
old3
```

and `newFile` is
```
new1
old1
old2
old3
new2
```

will output
```
REMOVED: gone1
NEW: new1
NEW: new2
```

See also [delta.txtar](delta.txtar) for examples (tests)