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
- Host: GitHub
- URL: https://github.com/fortio/delta
- Owner: fortio
- License: apache-2.0
- Created: 2023-01-06T22:02:21.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-08T04:14:59.000Z (6 months ago)
- Last Synced: 2025-04-08T05:19:47.583Z (6 months ago)
- Language: Go
- Size: 102 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](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)