6

I am having an issue using git under Cygwin.

I am able to store values using

git config --global user.name <name>

This places the config file in the correct directory (cygwin64\home\user)

I can then use:

git config --global --list

to read these values

However and this is the issue I'm having

git config --global --edit

opens my configured editor (Sublime Text) but looks for .getconfig in home\seven instead of the correct directory of cygwin64\home\seven

I don't understand how git can know where to put these values but can't point the editor to the correct location for reading/editing them.

Please help and let me know if you need any more information.

Thanks

Update: Just tried to do a commit and it then opens my sublime text editor, but when trying to save the commit message I get the following error:

Unable to save C:\cygdrive\c\dev......git\COMMIT_EDITMSG Where dev is just a local folder at the root of C

I feel like I'm missing something obvious here

iisevensii
  • 61
  • 4
  • 1
    Did you ever figure this out? I'm having trouble with this now too and can't find a solution. I love my Cygwin setup and it'll be a real shame if I can't use an editor for commits. – Jordan Harris Jul 23 '15 at 08:37
  • Are you using Cygwin git or Windows git? I'm running into this trouble and finding it's because I'm using Windows git with Cygwin ... the path translation is getting mucked up inbetween them. This answer had some help: https://superuser.com/questions/638854/git-fails-to-launch-vim-in-cygwin – Aaron Wallentine Mar 24 '17 at 22:49

1 Answers1

0

For testing, try and set your core.editor to a script calling SubluimeText with the right path, as I mentioned in "How to change git path from C:\cygdrive\c\"

git config --global core.editor /path/to/sbt

Use cygpath to convert Unix and Windows format paths:

/path/to/sbt (make sure it is executable):

#!/bin/bash
/cygdrive/c/Program\ Files/Sublime\ Text\ 3/sublime_text.exe -w -n $(cygpath -w $@)
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250