views:

46

answers:

2

When I run commit from a standard command prompt it is opening the configured editor defined by the core.editor configuration value and uses the template defined by commit.template.

However when I run commit from the bash command prompt it is ignoring these settings and opening the VI editor without the template. Why is this?

I am not so worried about the editor but I need to define the commit template.

+3  A: 

If those settings are global ones (i.e. defined in "$HOME/.gitconfig" file rather than in your local repository .git/config file), that means they are defined in your HOME.
That "home" can differ between the windows session (cmd) and the bash session.
Check the value of $HOME in your bash session.

  1. It should be defined
  2. you should see a .gitconfig file in the directory referenced by your $HOME environment variable.
VonC
Excellent this solved my issues. Thanks a lot.
Dan Ryan
A: 

I was having a similar problem using the Git Bash shell. I set the environment variable GIT_EDITOR to the path of the editor you want to use. Then after a reboot git started using my default editor.

GIT_EDITOR = "C:\Program Files (x86)\e\e.exe"

Hope that helps.

mpenrow