Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use git bash in sublime text 3

I use Sublime Text 3 as my default text/code editor and I very frequently use the terminal in Sublime Text 3 with the Terminus package. And recently I've discovered git it has a really wonderful bash and I prefer using the git bash instead of using git through the default Windows terminal.

Is there any way that I can do it?

like image 222
an4s911 Avatar asked Dec 11 '22 00:12

an4s911


1 Answers

To do this, open the Terminus preferences by choosing Preferences > Package Settings > Terminus > Settings from the menu or Preferences: Terminus Settings from the command palette.

Both will open the Terminus settings in a new split window, with your settings on the right and the defaults on the left. What you need to do is add a shell_configs key to your preferences (the right pane) that includes a new configuration for using Git Bash.

That would look something like this:

    "shell_configs":
    [
        {
            "name": "Git Bash",
            "cmd": ["cmd.exe", "/k", "C:/Program Files (x86)/Git/bin/bash.exe"],
            "env": {},
            "enable": true,
            "default": false,
            "platforms": ["windows"]
        },
    ]

Replace the path to Git Bash as appropriate if it's not installed in the default location. You can also set default to true instead of false if you want to use it by default.

If you add this setting to your preferences as it appears here, then the only shell configuration that will exist will be this one. If you want to still be able to use the other configurations as well, then copy the default value of the setting from the Left pane to the right, and then add yours to the list (remember that all of the settings need to be comma separated).

like image 103
OdatNurd Avatar answered Dec 26 '22 00:12

OdatNurd