gitgithubvisual-studio-code

How to change vscode pushing code to master branch to main branch?


When I am trying to push my code, vscode issues the command git push origin main:master instead of git push origin main. How do I change it?


Solution

  • You need to change your local main branch to track origin/main instead of origin/master:

    git branch --set-upstream-to=origin/main main