8

I am using the Git CLI in Cygwin on Win7. I have a problem when I issue a command that requires editor interaction, such as

git commit --amend 

In Cygwin, the command simply hangs and I must do Ctrl-Z to get the next prompt. The commit does not go through.

I tried to set the default editor to vi:

git config --global core.editor "vi" 

But that did not work.

In Windows Terminal (DOS-like CLI), it redirects to a vi-like editor fine, i.e. business as usual. But it doesn't work in Cygwin. I prefer using Cygwin over Terminal because I was having some other issues in Terminal (wasn't showing which remotes the locals are tracking etc.)

How do I set the default editor when using Git on Cygwin?

1 Answer 1

11

As per this answer, I did the following:

git config --global core.editor "D:/homex/SFTWR/cygwin/bin/vi.exe" 

D:/homex/SFTWR/cygwin is the location of my Cygwin install. I am still perplexed why it is taking a Windows path when it's running in the Cygwin shell.

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

2 Comments

Alternativly you can use the GIT_EDITOR environment variable.
I used the cygwin path and it worked for me. My guess would be, cygwin's smart enough to convert your Windows path into a cygwin path.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.