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のcore.autocrlf設定で改行コードを統一しよう

Posted at

はじめに

  • 改行コードの種類(LFとCRLF)について簡単に解説
  • チーム開発や異なるOSで作業する際に起こりがちなトラブル

改行コードの違いとは?

  • LF(Line Feed) → Unix/Linux/macOS
  • CRLF(Carriage Return + Line Feed) → Windows
  • Gitが改行コードをどう扱うかが重要な理由

Gitのcore.autocrlfとは?

  • core.autocrlfの3つの値とそれぞれの動作

    • true
    • input
    • false

input設定の意味と用途

  • git config --global core.autocrlf input の解説
  • macOS/Linuxユーザーにとっての利点
  • CRLFの混入を防ぐ仕組み

.gitattributesでさらに安心設定

  • .gitattributes の基本
  • 改行コードの強制方法(例:* text=auto eol=lf
  • チーム全体で一貫性を保つ方法

よくあるトラブルと対処法

  • 改行コードの差分が大量に出る問題
  • VSCodeやエディタ側の改行設定
  • Windowsユーザーとの協業時の注意点
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?