chore(diff): get better diffs in the terminal

This commit is contained in:
Michele Cereda
2024-05-02 02:03:01 +02:00
parent 9be6d5f1e1
commit d068c616f0
3 changed files with 18 additions and 0 deletions

View File

@@ -112,6 +112,7 @@ git log -p 'feature' --not 'master'
# Just show changes between two files.
git diff --no-index 'path/to/file/a' 'path/to/file/b'
git diff --no-index --word-diff --patience 'path/to/file/A' 'path/to/file/B'
# Stage changes for commit.
git add .
@@ -584,6 +585,7 @@ git diff --word-diff='porcelain'
# DO NOT consider them part of of the repository.
# This can be used to diff any two files.
git diff --no-index 'path/to/file/A' 'path/to/file/B'
git diff --no-index --word-diff --patience 'path/to/file/A' 'path/to/file/B'
```
Better word-aware diff: