23

I want to add git bash to the windows terminal, however, when I add a new git bash tab in the terminal the git bash opens in a different window.

Here's my configuration:

{
    "guid": "{--------------------}",
    "acrylicOpacity" : 0.75,
    "closeOnExit" : true,
    "colorScheme" : "Campbell",
    "commandline" : "C:\\Users\\anonymous\\AppData\\Local\\Programs\\Git\\git-bash.exe",
    "cursorColor" : "#FFFFFF",
    "cursorShape" : "bar",
    "fontFace" : "Consolas",
    "fontSize" : 10,
    "historySize" : 9001,
    "icon" : "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
    "name" : "Git Bash",
    "padding" : "0, 0, 0, 0",
    "snapOnInput" : true,
    "useAcrylic" : true
}

Output:

enter image description here

What am I missing?

oguz ismail
  • 1
  • 16
  • 47
  • 69
Roy
  • 1,612
  • 2
  • 12
  • 38

3 Answers3

39

I don't know if that's the correct solution, but I tried changing it to open the sh.exe in the bin folder, with the argument --login and it works now.

EDIT

As mentioned in the comments, bash.exe can also work. (Anything in the bin folder)

Roy
  • 1,612
  • 2
  • 12
  • 38
  • 6
    Yes, this is an appropriate solution, use any of the shells in the 'Git/bin' directory, you can also use `bash.exe` instead of `sh.exe`. – estherwn May 23 '20 at 08:22
  • 1
    It's the "correct" solution if you want a bash instance that doesn't open in a new window. However that bash doesn't have a git command. I named it "NoGit Bash" in my config, and "Git Bash" still opens in a new window. – Wes May 28 '20 at 11:30
  • Haven't you noticed issues with messed up output of logs when running builds in bash.exe or sh.exe? When I run the build from git-bash.exe, I don't see any log output issues.. – hipokito Jan 12 '21 at 10:06
  • 1
    whats the difference between `\git-bash` and `\bin\bash`? – Tuor May 19 '22 at 04:04
  • 1
    is `\bin\bash` git-related, or is it just regular MinGW bash? – Tuor May 19 '22 at 04:20
  • Choosing `C:\Program Files\Git\bin\sh.exe` worked for me. – Bartleby Jul 20 '22 at 18:14
3

If you installed git using scoop, you can use C:\Users\xxxxx\scoop\apps\git\current\bin\bash.exe as command line

Olivier Gérardin
  • 1,113
  • 14
  • 27
2

Select git-cmd instead of git-bash while adding profile in terminal an change the starting directory in settings by selecting Git Bash profiles.

My settings:

    {
        "commandline": "C:\\Program Files\\Git\\git-cmd.exe",
        "guid": "{******************************}",
        "icon": "C:\\Program Files\\Git\\git-for-windows.ico",
        "name": "Git Bash",
        "startingDirectory": "C:\\xampp\\htdocs"
    },

enter image description here