LoginSignup
9
10

More than 5 years have passed since last update.

git diffでの文字化け対策

Posted at

あるプロジェクトだけ

基本は UTF-8 なんだけどこのプロジェクトだけ EUC とか Shift-jis とかあるw
そいで ~/.gitconfig には UTF-8 って書いてあったりしてそこは変えてなくない!w

というわけで

そのリポジトリ1だけを設定したい。

~/bin/diff-wrapper
#!/bin/bash

old=$2
new=$5

diff -Nau <(lv $old) <(lv $new) | cat

上記のファイルを作成し、以下のコマンドで設定

$ chmod +x ~/bin/diff-wrapper
$ git config diff.external ~/bin/diff-wrapper

参考サイト


  1. とあるプロジェクト 

9
10
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
9
10