3

I'm following a novice guide for Git and Github, but I'm having problems to connect Git Bash with Sublime Text.

I'm using Windows 10 and to use Git I have installed Git Bash. Once I installed this, I created an alias like this:

echo 'alias subl="C:/Program\ Files/Sublime\ Text\ 3/sublime_text.exe"' >> ~/.bashrc

Then I wrote this to test if this worked:

source ~/.bashrc

With this I can open Sublime Text from my Git Bash:

subl hi.txt

And to make Git Bash remeber where to find this alias everytime I open it, I created a .bash_profile and wrote this:

if [ -r ~/.profile ]; then . ~/.profile; fi
case "$-" in *i*) if [ -r ~/.bashrc ]; then . ~/.bashrc; fi;; esac

With this, I can open Sublime Text properly, but by some reason, git can't use this command. I wrote this on Git Bash:

git config --global core.editor "subl -n -w"
git config --global push.default upstream
git config --global merge.conflictstyle diff3

But when I do a commit, it says that subl -n -w is undefined while it is, because if I try to use this command manually it works.

I tried to write the route directly like this:

git config --global core.editor "'C:/Program\ Files/Sublime\ Text\ 3/sublime_text.exe' -n -w"

But this way, Git says that this route doesn't exist. I tried to use this command manually and it works properly.

I thought this problem was related with Sublime Text, so I installed Package Control and then, installed Git package, but it still doesn't work.

Maybe it's foolishness, but I'm still a novice and I don't know what is happening here. Am I missing something?

Sumary:

subl hi.txt -> works
subl -n -w -> works
git commit -> doesn't work
Ise92
  • 127
  • 1
  • 1
  • 12
  • I'm really sorry, I looked for this but I didn't find anything related. Yes this is duplicated, that solved my problem, Thank you very much. – Ise92 Dec 30 '16 at 19:58

0 Answers0