

SET ORIGIN AS MASTER GIT FREE
Please feel free to sanitize the URLs in the output of the first command prior to sharing it, but leave the branches names in the output of the last two commands if that's ok, so we can check what the current status of the branches are. If there's still confusion/issues and you haven't managed to resolve this, could you let me know what is the output of the following commands in your local clone? git remote -v You just need to set your local branch named 'master' (or 'main', if you have renamed your local branch), to track the remote branch origin/main. There is no need to set a second remote named 'main'. If you execute the command git remote -vĭo you see a remote named 'main' listed in there?

I am a bit confused also about the remote 'main' that you mentioned. There is no need to change the origin if the URL looks like this is correct. This way, you will not be asked to enter your Bitbucket username every time you pull from or push to the Bitbucket repo from your local one. If you click the Clone button, then the clone command for HTTPS authentication (username+password) will look like this includes your own Bitbucket username, and that URL is set as a remote in your local clone. When you open a repository in your browser, the URL is indeed Please feel free to let me know if this helps and if you have any questions. If you see a different name, you'll need to use that one instead of 'origin' in the commands above. Then this confirms the remote's name is indeed origin. You can confirm if this is the case for your repo by running the command git remote -v The commands above assume that the repo's remote is named 'origin', which is the default name created for a remote. Then, rename it to 'main' with the command git branch -m mainĪnd set origin/main as the remote tracking branch with git branch main -u origin/main First, make sure that 'master' branch is checked out locally. If you want, you can also rename your local branch to main, to avoid any confusion. If your want your local branch 'master' to track the remote branch 'main', you can open a command line tool/Git Bash, navigate to the directory of the repo, and then run the command: git branch master -u origin/main
SET ORIGIN AS MASTER GIT HOW TO
If you don't see an option to change this from VS Code, I can let you know how to change this from command line: If you can see a list of branches in VS Code, perhaps right-clicking the 'master' branch will show you and give you the ability to change the remote tracking branch to 'main' instead of 'master'.įrom the description of your issue, it sounds like your local branch 'master' is tracking a remote branch named 'master', which would explain why pushing 'master' branch creates a 'master' branch in the Bitbucket repo. Most Git GUI applications offer the ability to set which remote branch a local branch is tracking. First, allow me to say that I am not very familiar with VS Code.
