---
title: "Discussion on \"Change GitHub default branch from master to main\" | Hashnode"
description: "Discussion on \"Change GitHub default branch from master to main\". Step 1\nCreate main branch locally, taking the history from master\ngit branch -m master main\n\nStep 2\nPush the new local main branch to the remote repo (GitHub) \ngit push -u origin main\n\nStep 3\nSwitch the current HEAD to the main branch\ngit symbolic-re..."
url: "https://hashnode.com/posts/change-github-default-branch-from-master-to-main/6308e2184d50fd71142c7746"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Change GitHub default branch from master to main](https://blog.manojbhatta.com.np/change-github-default-branch-from-master-to-main?utm_source=hashnode&utm_medium=feed)

Step 1 Create main branch locally, taking the history from master git branch -m master main Step 2 Push the new local main branch to the remote repo (GitHub) git push -u origin main Step 3 Switch the current HEAD to the main branch git symbolic-re...

Aug 26, 2022 · 1 min read · blog.manojbhatta.com.np  
Read the article

-   [#github](https://hashnode.com/tag/github)

## Written by

[James Bhatta](https://hashnode.com/@jamesbhatta)

@jamesbhatta

  
[View profile](https://hashnode.com/@jamesbhatta)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
