1
1

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 Bash (for Windows)

1
Last updated at Posted at 2023-07-09

こんにちは。
Git Bash (Git for Windows) をインストールし使いました。

導入手順

winget を用い、PowerShell 上にて、

PS> winget install -e --id Git.Git
PS> winget install -e --id Microsoft.WindowsTerminal
PS> winget install -e --id Microsoft.PowerShell

次に、Windows Terminal へ Git Bash を登録・追加する1

動作確認

Git Bash を Windows Terminal 上で動かし、各種コマンドを動作確認する。例えば、

$ which sshd.exe
/usr/bin/sshd.exe
$ echo $PATH | tr ':' '\n' | less
 ...
$ ps aux
 ...
$ winget upgrade
 ...

Git Bash が標準提供しないコマンドを入手する

winget 利用
  • wget2
  • pwsh (PowerShell 7.x)
そのほか
未調査

下記は未調査です:

  • gcc.exe (「MinGW-w64のダウンロードとインストール」が必要とのこと)
  • lv.exe (gcc.exe を用いてソースをコンパイルする必要があるとのこと)

~/.bashrc 例

~/.bashrc へ alias 定義を加えた例です。

alias open='explorer'
alias lv='less -i'

PowerShell スクリプト動作例

$ pwsh -File winget_test.ps1
winget_test.ps1
#!/usr/bin/env pwsh
winget upgrade
  1. 参考:「Windows Terminal で Git Bash を表示する

1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?