Noriyo Akita's Today I Learned

# 2024-10-10

Table of Contents

2024-10-10

git diff-highlight を有効にする

Terminal window
$ git config --global pager.log "diff-highlight | less"
$ git config --global pager.show "diff-highlight | less"
$ git config --global pager.diff "diff-highlight | less"
# ~/.gitconfig
[pager]
log = diff-highlight | less
show = diff-highlight | less
diff = diff-highlight | less
# そのままだと not found が出るのでシンボリックリンクを貼った
$ sudo ln -s /usr/share/doc/git/contrib/diff-highlight/diff-highlight /usr/local/bin/diff-highlight
# ~/.bashrc に書くのだとうまくいかなかった
export PATH="$PATH:/usr/share/doc/git/contrib/diff-highlight/diff-highlight"
# Permission denied が出るので
$ sudo chmod +x /usr/share/doc/git/contrib/diff-highlight/diff-highlight

参考:

https://tech-broccoli.life/articles/engineer/enable-diff-highlight

https://qiita.com/SakaiYuki/items/2814d417d0bec59046bb

My avatar

Thanks for reading my blog post! Feel free to check out my other posts or contact me via the social links in the footer.


More Posts