LoginSignup
1
3

More than 3 years have passed since last update.

【環境構築】WindowsTerminal & GitBash

Last updated at Posted at 2020-06-27

この記事 is 何?

windows10homeにWindowsTerminalインストールして、そこからGitBash使えるようにした手順。
忘れそうなのでメモった。

書いた日:2020/06/27

各種インストール

WindowsTerminal

公式ドキュメント 参照。

git for windows

こちら からダウンロード。
image.png
自動でダウンロードされるらしい。
このときは自動ダウンロードされなかったので、Click here to download manuallyをクリックして手動でexe取得。

インストール時の設定はすべてデフォルトにしました。

設定

WindowsTerminal

フォントの指定

せっかくだからプログラミングフォントにしようぜー
お好みのフォントをインストールして、settings.jsonを修正。

"profiles":{"defaults":[ ]}の中に書けば、全てのlistに対して設定が適用される。
ウチは Source Han Code JP(源ノ角ゴシック)にしてます。

settings.json
"fontFace": "Source Han Code JP",
"fontSize": 10

GitBashを使えるようにする

  1. powershell開いて、guidを新規取得

    [guid]::NewGuid()
    
  2. settings.json修正
    "profiles":{"list":[ ]}の中にPowerShallとかの設定があるはずなので、コピペしてGitBashの設定を作る。
    ※ guidは 1 で取得したヤツを使う。
    こんな感じに設定した。

    settings.json
            {
                "guid" : "{d8b7db0c-378a-4605-abca-65f46997540b}",
                "name" : "Git Bash",
                "commandline" : "C:\\Program Files\\Git\\bin\\bash.exe --login -i",
                "hidden": false,
                "acrylicOpacity" : 0.5,
                "useAcrylic" : true,
                "icon" : "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
                "startingDirectory" : "D:\\git/"
            }
    

GitBash

日本語対応

日本語のファイルが文字化けするので、~/.bashrcにロケール設定を書いとく。
~/.bashrcは無ければ作る。

export LANG=ja_JP.UTF-8

git config

GitBash開いて、とりあえず下の2つ(commit時のユーザー名とメアド)だけ設定。

.gitconfig
$ git config --global user.name "ユーザー名"
$ git config --global user.email "メールアドレス"
1
3
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
3