When I wanted to diff, the default one had no color and the display was hard to see.
After investigating, I found that there is something called colordiff. https://qiita.com/trapple/items/6657b903bf027464e70d
This alone seemed to be good, but I thought it would be easier to see if I used a rust product called delta, so I considered this. https://wonderwall.hatenablog.com/entry/rust-delta
download
$ wget https://github.com/dandavison/delta/releases/download/0.4.1/delta-0.4.1-x86_64-unknown-linux-musl.tar.gz
$ tar -zxvf delta-0.4.1-x86_64-unknown-linux-musl.tar.gz
$ cd delta-0.4.1-x86_64-unknown-linux-musl
I already have a bin file so I just had to move it
$ mv ./delta /usr/local/bin
.gitconfig
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
Now delta is reflected when you do git diff
Adjust various settings
.gitconfig
[delta]
diff-so-fancy=true
keep-plus-minus-markers=true
minus-emph-style="bold 94 89"
plus-emph-style="bold 29 29"
hunk-header-style="omit"
line-numbers=true
before
after
This makes it easier to see because you can replace the diff when it is not git with the delta command.
before
after
Recommended Posts