Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active March 2, 2024 19:18
Show Gist options
  • Save plembo/e7c40d1f78740d257efb5085030b03fa to your computer and use it in GitHub Desktop.
Save plembo/e7c40d1f78740d257efb5085030b03fa to your computer and use it in GitHub Desktop.
Git-Bash in Windows Terminal

Git-Bash in Windows Terminal

Windows Terminal is a nice console for Windows. With the latest version of it a prior or subsequent install of Git for Windows does does not show up among the available terminals, so if you want it you'll need to add it manually.

NOTE: The latest versions of Windows Terminal allow you to create and edit profiles in Settings. Use the paths for bash.exe and git-for-windows.ico below and it will work as advertised (don't just copy and paste: the path separators won't work in the Settings gui if they're escaped). Apart from being able to set things up visually, a big advantage of the new method is that you don't have to make up a guid :-)

To add Git-Bash to Windows Terminal, open the Windows Terminal Settings and paste in block of profile code:

{
    //Git-Bash profile
    "guid": "{4ce70db7-3214-4d5e-bace-dbebe0a7b49d}",
    "hidden": false,
    "name": "Git-Bash",
    "commandline": "%PROGRAMFILES%\\Git\\bin\\bash.exe",
    "startingDirectory": "%USERPROFILE%",
    "icon": "%PROGRAMFILES%\\Git\\mingw64\\share\\git\\git-for-windows.ico"
}

Note: Strictly speaking, the "guid" should be generated on the system being configured. You can use the New-Guid PowerShell (version 7) utility to do that. The guid is important as each profile needs a unique one to function. Also, the default terminal is specified by its guid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment