DEV Community

loading...
Cover image for 🔥 Changing Your Git Repository From Master To Main 🔥

🔥 Changing Your Git Repository From Master To Main 🔥

Aosu Stephen Terver
Hey! I am a tutor at CareerFoundry and a freelance Fullstack Developer.
Updated on ・1 min read

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.

Discussion (0)