0

I have installed those below on my Windows 10 x64:

  1. git-bash (portable)
    • GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
    • git version 2.27.0.windows.1
    • bash path: "C:\Users\alazt\developer-folder\git-folder\PortableGit\bin\bash.exe"
    • git path: "C:\Users\alazt\developer-folder\git-folder\PortableGit\bin\git.exe"
  2. sublime-text (portable)
    • Sublime Text Unregistered Version 3.2.2, Build 3211

I want to use "Git" Sublime package but cannot find how to configure git path.

I get this error when I try, for example, git fetch command:

'git' is not recognized as an internal or external command, operable program or batch file.

I cannot find how to configure settings JSON to set the path for git.

Below settings didn't work:

{ "git_command": "C:\\Users\\alazt\\developer-folder\\git-folder\\PortableGit\\bin\\git.exe" } 

or

{ "terminal": "C:\\Users\\alazt\\developer-folder\\git-folder\\PortableGit\\bin\\git.exe" } 

How can I use git commands inside Sublime Text via 'Git' package?

4
  • Please edit your question to specify the full path of the file you put your "git_command" setting in. As far as I can tell the Git package has no "terminal" setting, what made you think that it had? Commented Dec 4, 2020 at 11:35
  • It is already in full path, I didn't get what you ask. Some Sublime-related websites recommend "terminal" key to specify the path. Commented Dec 4, 2020 at 19:21
  • What is the path to the SETTINGS file containing your "git_command". Commented Dec 4, 2020 at 21:49
  • ...\Sublime Text Build 3211 x64\Data\Packages\User\Preferences.sublime-settings Commented Dec 11, 2020 at 9:16

1 Answer 1

1

The Git package has its own settings file called Git.sublime-settings, the default settings file can be seen on the plugin's GitHub page. The plugin does NOT store its settings in Preferences.sublime-settings.

Save the settings file below in your Sublime Text Packages User directory as Git.sublime-settings, based on your comment the path to it should be:

..\Sublime Text Build 3211 x64\Data\Packages\User\Git.sublime-settings 
{ "git_command": "C:\\Users\\alazt\\developer-folder\\git-folder\\PortableGit\\bin\\git.exe" } 

The example Windows path given by the plugin is "C:\bin\git.exe" which uses single slashes \ but, as you have already shown, double slashes \\ are likely to be needed. However if the path fails try replacing the double slashes with single slashes.

Please note that there is no terminal command shown in the plugin's Git.sublime-settings file.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.