2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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
2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?