If you use branches in your workflow, you may need to update the branches to work with the new main branch. On that branch dropdown, select View all branches, then delete master. The only thing left to do is to cleanup your master repository. If you go back to the main repo page and select the branch dropdown, you’ll notice main now has the default tag on it. The select Update and follow the prompts. ![]() Once you’re on the branches settings page, select the branch dropdown under the Default Branches section and select main. Navigate to the Settings tab, then choose Branches in the sidebar menu that pops up. As you can see in the image below, master is set to my default, and there’s another branch called main. You can verify that your branch was successfully pushed by selecting the Branch: master tab. Navigate to your repository, for me that is /aashnisshah/aashnime. Locally, your work is done! Next you’ll need to log in to your git manager to make a couple more changes. The -u command creates an upstream connection. Next we want to push the main branch changes up to the remote origin (where your code is stored). How to Change the Name Locallyįirst check to make sure you have no out of date or unstaged changes. Historically, the main branch created when a repository is initially created is called master. Most teams use a system where they have a main branch to represent their production version of code, one for their staging environment, and then create feature branches anytime they’re working on a change. What is a BranchĪ branch is a pointer to a sequence of commits or changes that you have made. I decided to write up a quick guide on how to easily change the name of your branch from main to master instead. But I couldn’t in good conscious include another post without writing or addressing the current conversation related to Black Lives Matter around using main instead of master as the name of your main branch. In this post, I originally wanted to explore unlocking more git flows like rebasing or using multiple branches. ![]() In a previous post we explored basic git commands.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |