DEV Community

Cover image for šŸ”„ Changing Your Git Repository From Master To Main šŸ”„
Aosu Stephen Terver
Aosu Stephen Terver

Posted on Edited on

šŸ”„ Changing Your Git Repository From Master To Main šŸ”„

It has become imperative for us to remove the master/slave terms from our codes.

I will be showing you how I did that for my local git repository.

Simply get into your project directory from the terminal and run the following command:

git branch -m master main
Enter fullscreen mode Exit fullscreen mode

For this command to work as expected, make sure you have made some commits on the branch.

And viola! šŸ’„ that is it. You can now push to your remote.

Top comments (1)

Collapse
 
dapone profile image
Afisunlu Dapo •

Great!