Source Control seems not recognizing the error message given by git correctly
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.97.2
- OS Version: macOS Sequioa 15.0.1
Background: Due to some reasons, I added ProxyCommand to my SSH configuration in order to stablize the connection to GitHub. There's an extra message displayed each time the connection is created.
Connection to ssh.github.com port 443 [tcp/https] succeeded!
Today I was trying to push using the built-in Source Control panel and got this:
This makes no sense. I checked the command output and found that the actual cause is some common misconfiguration.
> git pull --tags origin main
Connection to ssh.github.com port 443 [tcp/https] succeeded!
From ***
* branch main -> FETCH_HEAD
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint: git config pull.rebase false # merge
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.
So the success connection message is shown instead of fatal: Need to specify how to reconcile divergent branches. in the popup. It worked fine after I, according to the output, specified the reconcilement policy through command line.
Steps to Reproduce:
- Add
ProxyCommandsettings to ssh configuration and start the proxy. Example:
Host github.com
HostName ssh.github.com
Port 443
User git
ProxyCommand nc -v -x 127.0.0.1:PORT %h %p
This step generates the extra message Connection to ssh.github.com port 443 [tcp/https] succeeded!
2. I think any fatal error can reproduce the popup. For the error I encountered:
- Unset any reconciling policy of git. e.g.
git config --unset pull.rebase - Do something to produce divergent branches, like committing to the remote repository without local sync.
- Make changes locally, commit & push to the remote in built-in Source Control panel.
- This would lead to
fatal: Need to specify how to reconcile divergent branches., but the success info is shown instead.