LoginSignup
1
0

More than 1 year has passed since last update.

M1MacのHomebew3で入れたgitのdiffにdiff-highlightを反映

Posted at

検索するといっぱい出てくるのですが、そこにdiff-highlightが無いんですよね。結論を言うとHomebrewのインストール先が変更されてたのでパスが変わったようです。

M1MacのHomebewはインストール先が/usr/local/binから/opt/homebrew/binに変わったようです。そういえばインストールした時に~/.zprofileeval "$(/opt/homebrew/bin/brew shellenv)"を書けって出ましたね。

以前は/usr/local/share/git-core/contrib/diff-highlight/diff-highlightを実行できるようにしてpagerに指定していたのですが/opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlightを指定しないとダメなようです。

パスの通ってるとこにシンボリックリンク貼るパターンが多いですが、たぶんgitでしか使わないのでフルパスで指定しちゃいました。

# ~/.gitconfig

[pager]
    log = /opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight | less
    show = /opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight | less
    diff = /opt/homebrew/share/git-core/contrib/diff-highlight/diff-highlight | less
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0