3 Step To Change Default Github Master to Main

Since October 2020, Github made change about naming master branch to main branch as default when you create a repository.

So how about the existing repository and you want to change to main branch as default.

Here is how to do it in three steps.

# Step 1 
# create main branch locally, taking the history from master
git branch -m master main

# Step 2  
git fetch origin

# Step 3
git branch -u origin/main main

Check the git status.

# git status
On branch main                                                                                                          Your branch is up to date with 'origin/main'.                                                                                                                                                                                                   nothing to commit, working tree clean 

Done, now you have synced to main branch.



Originally posted 2020-12-21 17:12:17.

See also  How to add a user to a group on Linux

About wahyuway

Check Also

How to install and configure Anaconda on CentOS 7

How to install and configure Anaconda on CentOS 7

Anaconda is the most popular machine learning and data science tool used in large scale …

Leave a Reply