0

I have a remote repository with 2 branches.

  • main
  • master

Main is the default, and it's completely empty. All my changes are being committed and pushed to master. I just want to change everything over (locally and remotely) so that I'm working in the default new standard "main".

Which commands should I run to make this happen?

tldr; Locally I am working in master, and main doesn't exist. Remotely both branches exist, the default is main and all my files are pushed to master. I want to change it all over so I'm just working in "main" both locally and remotely.

Jeremy W
  • 65
  • 3

1 Answers1

1

First say

git checkout master
git branch -M main

to rename your local master as main. Now push, perhaps pulling first, to make the remote master look the same as your branch new local master. Finally, delete the remote master.

William Pursell
  • 204,365
  • 48
  • 270
  • 300
matt
  • 515,959
  • 87
  • 875
  • 1,141