Closed p-lucero closed 6 years ago
I've configured Sublime Text 3 to be my default editor when using Git for Windows.
You configured this in your $HOME/.gitconfig
, right? In other words, you override whatever system configuration there is. So you're safe.
Besides, the default (vim
) is the default chosen by Git itself, i.e. the Git for Windows installer does not even configure anything if you choose that.
Does that address your concern?
Ah, I see; I assumed that the installer would itself edit my $HOME/.gitconfig
, which is indeed preserved after install. My apologies for overreacting, that does indeed address my concern.
I do have a follow-up question, though: if this doesn't edit $HOME/.gitconfig
, what does it edit, and why does whatever that is get overridden by $HOME/.gitconfig
?
if this doesn't edit $HOME/.gitconfig, what does it edit,
It edits the "system config", i.e. C:\Program Files\Git\mingw64\etc\gitconfig
.
and why does whatever that is get overridden by $HOME/.gitconfig?
Git has several sources for config settings, in a very strict hierarchy:
C:\ProgramData\Git\config
C:\Program Files\Git\mingw64\etc\gitconfig
%USERPROFILE%\.gitconfig
(actually %HOME%\.gitconfig
, or if HOME
does not exist, %HOMEDRIVE%%HOMEPATH%\.gitconfig
and only if that does not exist, either, %USERPROFILE%\.gitconfig
).git\config
in your repository (if the current directory is inside a Git worktree)-c
as in git -c user.email=override.my@email.com commit
There is another obscure one (inherited from Linux conventions) between 2 and 3, but in practice it does not matter on Windows. For more information, see the git-config
help page (via git help config
): https://github.com/git-for-windows/git/blob/5d5baf91824ec7750b103c8b7c4827ffac202feb/Documentation/git-config.txt#L231-L284
I apologize for avoiding the standard issue template; it really doesn't fit here. My problem, in short, is this: I've configured Sublime Text 3 to be my default editor when using Git for Windows. The installer for Git for Windows 2.15.1.2 asks me to select a default editor used by Git. I would like to leave my default editor as Sublime Text 3, but there doesn't appear to be an option for that; anything that I choose would overwrite my current selection. I'm really not enthusiastic about having to fix my default editor every time that Git updates; is there any chance that you can work on adding an option to leave the default editor unchanged in the installer?