gitvisual-studio-code

VS Code Sync Changes: Always pushes to master


After commiting changes, when I click the "Sync changes"-Button it always tries to push to master, even though I am on another branch.Screenshot from VS Code

I am expecting it to push to the branch I am currently on.

Possible cause (in case this is not default behaviour): I am using a git sub-module inside my project.


Solution

  • First ensure that you are on the correct branch in the source control tab, open the command palette and type git checkout branch_name.

    If the above fails then test the submodule to ensure it is aligned with the remote settings by typing git submodule update --remote.

    In addition to the above i am pretty sure VSCode Git settings has some sort of stream defaults.

    Also check .git/config