I recently discovered the typos
command line tool and created the following workflow around it in Git repositories:
typos -w # writes the changes to file
git add -p # allows you to review the changes interactively
Some git
clients use line-based diffs, which make the differences difficult to see.
In these cases, you may want to switch to the diff-highlight
tool, which is shipped with Git.
On macOS with Apple Silicon and a Brew-installed git
, you can use these commands to make git use it:
git config --global pager.log '/opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight | less'
git config --global pager.show '/opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight | less'
git config --global pager.diff '/opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight | less'
git config --global interactive.diffFilter /opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight