-
Notifications
You must be signed in to change notification settings - Fork 36.7k
Open
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggitGIT issuesGIT issues
Milestone
Description
I experimented with the push.default strategies and discovered that the "Sync" button in the "Source Control" tab in the Activity bar and the "Git: Push" command in the Command Palette in VSCode 1.78.2 does something unexpected (for me at least) when git's push.default config is current and a local branch is tracking some remote branch with a different name.
I expected that VSCode will respect the setting and will behave similarly to the default push (git push without arguments), pushing changes to the remote branch named as a local branch instead of pushing the to the tracked upstream branch. Unfortunately, it didn't happen, VSCode still pushes new changes to the upstream branch.
Steps to reproduce:
- Setup a branch that tracks some remote branch with a different name:
$ git checkout -b feature/do-some-stuff origin/main- Set
push.defaulttocurrent:
$ git config push.default current- Do some stuff
$ git push --allow-empty -m test- Push with the git CLI. The remote
feature/do-some-stuffis created and updated.
$ git push
To <origin>:
* [new branch] feature/do-some-stuff -> feature/do-some-stuff
- Push with the "Sync" button and/or use the "Git: Push" command. It pushes changes to the remote
mainbranch. I would expect that it will push tofeature/do-some-stuff, as in step 4 (especially for the command).
<Press Sync>
<Git Output tab:>
To <origin>:
f649920..9d6b5fc feature/do-some-stuff -> main
lordmauve, janis-me, mbroz2, mjs and bstaeheli
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggitGIT issuesGIT issues