- --? "C:\ProgramData/Git/config"
- --system gitのある場所 C:/Program Files/Git/mingw64/etc/gitconfig
- --global $USERHOME ~/.gitconfig
- --local project
# 適用されているエディタ設定
git config --get core.editor
# 特定の場所でのエディタ設定
git config --global --get core.editor
# 全ての場所でのエディタ設定
git config --get-all core.editor
# 特定の場所での全ての設定
git config --system --list
# 全ての場所での全ての設定
git config --list --show-origin「個人で使うもの」と「共有するもの」
- 個人で使うもの
- .gitconfig 個人設定 user.name や core.editor など
- .gitignore_global 環境固有のファイルをignore 別の名前でもいい
- .gitattributes_global 別の名前でもいい
- 共有するもの
- .gitattributes
- .gitignore
- https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/
- https://kiririmode.hatenablog.jp/entry/20170416/1492300735
結論: .gitattributes を設定する。他は忘れてもいい。
設定を変えながら git add . --dry-run で試す。
- .gitattributes (project/.gitattributes)
- core.attributesFile (~/.gitconfig)
~/.gitconfig
- core.eol native/lf/crlf
- core.autocrlf false/true/input
- core.safecrlf warn/true/false
.gitconfig example
* text=auto
*.txt text
*.sh text eol=lf
*.cmd text eol=crlf
*.bat text eol=crlf
*.jpg -text
*.jpeg -text
*.png -text