You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# run this, or have Git installed as a prerequisite
.\Git-2.41.0.3-64-bit.exe /SUPPRESSMSGBOXES /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS=assoc,assoc_sh /VSNOTICE=1 /o:PathOption=Cmd
# set init.defaultBranch to any custom value
git config --system init.defaultBranch mycustombranch
# this is the command that, when run, will override the value we just set for init.defaultBranch
.\Git-2.41.0.3-64-bit.exe /SUPPRESSMSGBOXES /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS=assoc,assoc_sh /VSNOTICE=1 /o:PathOption=Cmd
What did you expect to occur after running these commands?
The entries in C:\Program Files\Git\etc\gitconfig would not be modified.
What actually happened instead?
init.defaultBranch was overridden by the installer to be master. It was previously set to be mycustombranch.
This problem is reproducible with the command line flags I included above to make the installation "silent", as well as using the GUI installer.
This seems to be related to this part of the installer flow:
I suspect this part of the installer flow should factor in whether or not this value is already set in the --system level gitconfig.
To my knowledge, no other properties (e.g. pull.rebase, core.autocrlf, mycustom.setting) were modified or overridden during the installation.
The text was updated successfully, but these errors were encountered:
luhansen-ms
changed the title
Git for Windows Installer overwrites init.defaultBranch
Git for Windows Installer overwrites init.defaultBranch value in system gitconfig
Aug 1, 2023
dscho
added a commit
to dscho/build-extra
that referenced
this issue
Aug 6, 2023
When a user configures the default branch name manually, i.e. edits the
system config themselves, the Git for Windows installer currently resets
it to whatever was specified when running the installer previously.
This is inconsistent with the way other defaults are inferred from the
system config, say, `core.symlinks`.
Let's make it consistent by interpreting the current value of
`init.defaultBranch` (if configured).
This addresses git-for-windows/git#4525.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When `init.defaultBranch` is changed manually in the system config,
subsequent Git for Windows upgrades [would overwrite that
change](git-for-windows/git#4525). This has
been [fixed](#515).
Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
Setup
Details
CMD
Minimal, Complete, and Verifiable example
this will help us understand the issue.
The entries in
C:\Program Files\Git\etc\gitconfig
would not be modified.init.defaultBranch
was overridden by the installer to bemaster
. It was previously set to bemycustombranch
.This problem is reproducible with the command line flags I included above to make the installation "silent", as well as using the GUI installer.
This seems to be related to this part of the installer flow:
I suspect this part of the installer flow should factor in whether or not this value is already set in the
--system
level gitconfig.To my knowledge, no other properties (e.g.
pull.rebase
,core.autocrlf
,mycustom.setting
) were modified or overridden during the installation.The text was updated successfully, but these errors were encountered: