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

Viewed 3234

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?

2 Answers

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

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

Click on the "..." sign in source control and select "Pull, Push">"Push to...".

You'll be prompted to select the branch to push to. enter image description here

Related