Help us understand the problem. What is going on with this article?

Ubuntu 18.04 で git diff-highlight へのパスを通す(リンク)

目的:キレイなdiffを出したい

そのためには、 diff-highligt というツールのバイナリが $PATH の中に存在していることが必要なのです。

What's diff-highlight

その名の通り、 diff の差分を highlighting して見やすくしてくれるツール。

ソース (GitHub)

2017年6月の コミット "diff-highlight: split code into module" より Makefile を使ってビルドが必要になりました。(v2.13.3~)

One small downside is that the diff-highlight script must
now be built using the Makefile.

しかし Ubuntu 18.04 最新 git パッケージでは既にビルド済みなので、シンボリックリンクの作成だけすればOKです

参考

手順

Install git

apt でインストール・アップグレードします。

$ sudo apt update
$ sudo apt install git

Link diff-highlight

$PATH の通っているところに、シンボリックリンクを置くことで対応します

$ sudo chmod +x /usr/share/doc/git/contrib/diff-highlight/diff-highlight
$ sudo ln -s /usr/share/doc/git/contrib/diff-highlight/diff-highlight /usr/local/bin/diff-highlight

Link 後 git をアップグレードした場合

実行権限だけ、再び追加します

$ sudo chmod +x /usr/share/doc/git/contrib/diff-highlight/diff-highlight
SakaiYuki
IoT の主に T 側の人です
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした