【Git】インストール・アップデート時の設定まとめ【Windows】
はじめに
普段 Windows で Git を使用しているのですが、 Git のアップデートをインストーラから行うときの設定を毎度忘れて調べているので、備忘録としてまとめました。
アップデートに限らず、インストーラから新規でインストールする際も同様になります。
動作環境
OS |
---|
Windows 10 Pro |
Application | Version |
---|---|
Git | 2.26.0 |
Git のインストール・アップデート時の設定
1. Select Components
- Additional icons
- On the Desktop
- Git Bashを起動するショートカットの作成
- On the Desktop
- Windows Explorer integration
- Git Bash Here
- Git GUI Here
- 右クリック時のコンテキストメニューへの追加
- Git LFS (Large File Support)
- LFSのインストール有無
- Associate .git* configuration files with the default text editor
- 拡張子が git で始まるファイルを既定のテキストエディタに関連付ける
- Associate .sh files to be run with Bash
- 拡張子が sh で始まるファイルを Git Bash で実行する
- Use a TrueType font in all console windows
- 全てのコンソールウィンドウのフォントを変更
- Check daily for Git for Windows updates
- Git for windows のアップデートを毎日確認する
注意
※ Use a TrueType font in all console windows は、文字化けの可能性があるため有効化しない方がいいらしい。
2. Choosing the default editor used by Git
- Use Visual Studio Code as Git's default editor
- Git で使用する既定のエディタを Visual Studio Code に設定
3. Adjusting your PATH environment
- Use Git from Git Bash only
- Git from the command line and also from 3rd-party software
- Use Git and optional Unix tools from the Command Prompt
注意
Use Git and optional Unix tools from the Command Prompt を選択した場合、 Windows の既存のコマンドにも影響を与える可能性があるため、上の二ついずれかを選択した方が無難。
4. Choosing HTTPS transport backend
- Use the OpenSSL library
- Use the native Windows Secure Channel library
5. Configuring the line ending conversions
- Checkout Windows-style, commit Unix-style line endings
- チェックアウト時に改行コードを
LF
からCRLF
に変換し、コミット時にCRLF
をLF
に変換する - システム全体の Git 設定ファイルに
core.autocrlf=true
を設定 - Windows 環境で推奨
- チェックアウト時に改行コードを
- Checkout as-is, commit Unix-style line endings
- チェックアウト時は改行コードを変更せず、コミット時に
CRLF
をLF
に変換する - システム全体の Git 設定ファイルに
core.autocrlf=input
を設定 - Unix 環境で推奨
- チェックアウト時は改行コードを変更せず、コミット時に
- Checkout as-is, commit as-is
- チェックアウト時・コミット時共に改行コードを変更しない
- システム全体の Git 設定ファイルに
core.autocrlf=false
を設定 - クロスプラットフォームプロジェクトでは非推奨
6. Configuring the terminal emulator to use with Git Bash
- Use MinTTY (the default terminal of MSYS2)
- Use Windows' default console window
7. Configuring extra options
- Enable file system caching
- メモリリソースを使用し、キャッシュを有効化
- システム全体の Git 設定ファイルに
core.fscache=true
を設定
- Enable Git Credential Manager
- Enable symbolic links
- シンボリック・リンクを有効化
おわりに
Git をアップデートする時は、インストールと同じ設定フローを通るのではなく、現在の設定を引き継いで一発で Git 本体だけをアップデートできたならいいなといつも思います。
でも、そうすると新しい環境に新規でインストールする時に設定を完全に忘れていそう…
現状はアップデートの度に設定を見直すことになるので、これはこれでアリなのかもしれませんね。
バージョン 2.26
あたりから Only show new options
という項目がインストーラの画面に追加されているのですが、バージョンアップで新規に追加された項目だけを表示するような設定なのでしょうか。
誰か知っている方教えてください!