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?

More than 3 years have passed since last update.

git-bashをVisual Studio 2019 のTerminalに追加する手順

Last updated at Posted at 2021-08-21

前書き

Visual studio 2019の最終版(Version 16.11.1)が出たので久しぶりにアップデートしたところ、右クリックのコンテキストメニューに「ターミナルで開く」という機能が(いつからか?)追加されていました。

open-terminal.png

デフォルトのシェルはPower-Shellでした。。VSCodeで使い慣れているgit-bashにするための設定手順を記載します。

powershell.png

設定画面を開く

  • 歯車マークをクリックして設定画面を開きます。
    下図は**「追加」**ボタンを押した直後の画面です。
    add-shell1.png

  • **「シェルの場所」を変更します。
    テキストボックスから直接入力しても適用ボタンが有効にならないので、大人しく
    「...」**ボタンをクリックしてファイル選択ダイアログを表示します。
    指定するパスは「"C:\Program Files\Git\git-bash.exe"」ではなく「"C:\Program Files\Git\bin\sh.exe"」です。間違えると別ウィンドウで開いてしまいます。

select-bash.png

  • 引数に「-l -i」をセットします。
    「.bash_profile、.bashrc」が読み込まれるので、エイリアスなど使えるようになります。

add-shell2.png

項目名 設定値 備考
名前 git-bash
シェルの場所 "C:\Program Files\Git\bin\sh.exe" 要:ボタンでダイアログを開いて選択
引数 -l -i
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?