I am using Git Bash in Windows 10, version: git version 2.25.1.windows.1
. Let me know if I need to be more specific. I am also using GitExtensions but my question is around merging from Git Bash.
When I merge from there, i.e.:
git merge feature-branch-name
it commits even though, as far as I can tell, all three of my Git config files are set otherwise. I know I can specify --no-commit
in the command but I would like not to have to do that.
From the source code directory, git config --list
produces the output below, where it shows three times that merge.commit=no
.
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=false
core.fscache=true
core.symlinks=false
core.editor="C:\\Program Files\\Notepad++\\notepad++.exe" -multiInst -notabbar -nosession -noPlugin
credential.helper=manager
merge.ff=no
merge.commit=no
core.editor="C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor
user.email=craig@wereallconnected.ca
user.name=Craig Silver
merge.tool=winmerge
merge.ff=no
merge.commit=no
mergetool.winmerge.path=C:/Program Files (x86)/WinMerge/winmergeu.exe
mergetool.winmerge.cmd="C:/Program Files (x86)/WinMerge/winmergeu.exe" -e -u -wl -wr -fm -dl "Mine: $LOCAL" -dm "Merged: $BASE" -dr "Theirs: $REMOTE" "$LOCAL" "$BASE" "$REMOTE" -o "$MERGED"
pull.rebase=false
fetch.prune=false
rebase.autostash=false
diff.guitool=winmerge
difftool.winmerge.path=C:/Program Files (x86)/WinMerge/winmergeu.exe
difftool.winmerge.cmd="C:/Program Files (x86)/WinMerge/winmergeu.exe" -e -u "$LOCAL" "$REMOTE"
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.sshcommand=ssh
merge.ff=no
merge.commit=no
submodule.active=.
remote.origin.url=REMOVED
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.puttykeyfile=REMOVED
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.FMS-1203_data-structures-algorithms-string-matching.remote=origin
branch.FMS-1203_data-structures-algorithms-string-matching.merge=refs/heads/FMS-1203_data-structures-algorithms-string-matching
branch.FMS-1205_recency-trumps-frequency-for-small-fr-diff.remote=origin
branch.FMS-1205_recency-trumps-frequency-for-small-fr-diff.merge=refs/heads/FMS-1205_recency-trumps-frequency-for-small-fr-diff
branch.FMS-1204_debug-window.remote=origin
branch.FMS-1204_debug-window.merge=refs/heads/FMS-1204_debug-window
Also, git config --get merge.commit
outputs no
.
FYI, GitExtensions behaves correctly: merging there does not commit.
What am I missing?
git
tools and plugins sometimes come with their own installation ofgit
, separate of your system's, and it could be that your configs, as well as versions, are different. – Andrei Mustață May 30 '20 at 6:39git merge
. That is, given that GitExtensions is a GUI, it has a bunch of clicky buttons, check boxes, radio buttons, and so on. You click some clickable thingy, and it does various actions. How does it do them? That's up to it, internally. But suppose it uses the CLI for some of them. Maybe for the "merge" button, first it checksmerge.commit
. If that is set tono
, it just runsgit merge --no-commit
. – torek May 30 '20 at 13:31git merge --no-commit
internally. After that, I bet it usesgit status --porcelain
to read the result. If the merge has conflicts, it goes on to do conflict resolution. If not, then it checksmerge.commit
. This is all enabled by the fact thatgit config
lets you invent your own arbitrary settings, so they invented their ownmerge.commit
.) – torek May 30 '20 at 13:32