Open in app
Home
Notifications
Lists
Stories

Write
Lu Daley
Lu Daley

Home

Feb 26, 2021

How to change your default git branch from master to main?

Issue A git repository uses the master branch and needs to be switched to main branch. Solution 1 — Create a new branch locally: git checkout -b main 2 — Delete the old default/master branch locally: git branch -D master

Git

1 min read

How to change your default git branch from master to main?

Issue

A git repository uses the master branch and needs to be switched to main branch.

Solution

1 — Create a new branch locally:

git checkout -b main

2 — Delete the old default/master branch locally:

git branch -D master

--

--

Lu Daley

Lu Daley

Following
  • Kennardo James

    Kennardo James

  • Linda Caroll

    Linda Caroll

  • Jeremy Helligar

    Jeremy Helligar

  • David Saint Vincent

    David Saint Vincent

  • DarkSkyLady

    DarkSkyLady

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Knowable