24
24

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 5 years have passed since last update.

git diff すると末尾に ^M が表示される

Posted at

Windows環境の方が良く出くわすと思われます。

現象

git diffで変更のあった行の末尾に ^Mがついていて見づらい/邪魔/恥ずかしい。
before.png

対処法

行末のキャリッジリターンを許容してあげる。

git config --global core.whitespace cr-at-eol

設定ファイルいじる派のあなたは

.gitconfig
[core]
  whitespace = cr-at-eol

結果

after.png

24
24
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
24
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?