1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Gitリポジトリ内の改行コード(CRLF)の混在チェック (Windows環境)

Last updated at Posted at 2024-08-30

きっかけ

具体的なコマンドがググっても意外とすぐに出てこなかったので…

コマンド

ターミナル環境(シェル)によってコマンドに微妙に違いがある。

Git Bash
git grep --cached -l -I $'\r'
PowerShell (VSCodeデフォルト)
git grep --cached -l -I "`r"

さいごに

core.autocrlfより.gitattributesを設定して根本的に混在を防ぎましょう。
.gitattributesで改行コードの扱いを制御する
もう迷わない .gitattributes で改行コードを統一

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?