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  snmpd an SNMP Agent

About wahyuway

Check Also

How To Install PHP 8 on Arch Linux | Manjaro

PHP 8 was released on November 26, 2020 and is ready for download and use …

Leave a Reply