Git is automatically opening a Terminal window when I save commit messages on my Mac. This might normally be useful (e.g. if the commit was initiated from a Terminal window), but I use iTerm as my terminal emulator and as such this is just annoying. Is there anyway to configure Git to either use iTerm or otherwise stop doing this altogether?
2 Answers
A-ha! So running env
and re-examining my environment variables, I came across this little gem:
EDITOR=mvim -f -c "au VimLeave * !open -a Terminal"
I had apparently set my editor (MacVim in this case) to automatically reopen my terminal window when I was done, long before I was using iTerm.app. Changing this to a simple
EDITOR=mvim -f -c "au VimLeave * !open -a iTerm"
alleviated my problem. Thanks for your answers and for providing me with the spark I needed to solve the problem!
I wonder if you system is trying to open a terminal window so you can enter the commit message? If so, you can make your commits without an editor like this:
git commit -m"My commit message here"
If you just type:
git commit
Then git opens an editor window so that you can provide the commit message. Hope this helps.
git config -l
?env
) so we can see what the editor-related variables are. Also, are you using some Git GUI interface, or the command line git?