Why does GIT not use the core.editor and commit.template configuration values when running from the bash command prompt?
When I run commit from a standard command prompt it is opening the configured editor defined by the core.editor
开发者_如何学Pythonconfiguration 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.
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.
- It should be defined
- you should see a
.gitconfig
file in the directory referenced by your$HOME
environment variable.
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.
精彩评论