Skip to content

Commit

Permalink
fixed the article about git main/master
Browse files Browse the repository at this point in the history
  • Loading branch information
nofutur3 committed Aug 20, 2024
1 parent 23e07ca commit c3fc88c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions content/blog/2021/06/git-rename-master-to-main/index.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
title: How to rename master to main | GIT
title: How to rename master to main at Git
date: "2021-06-01"
description: "Hello World"
description: "Do you want to have your main branch named to main instead of deprecated master? Not problem at all. Just follow these steps."
category: "tips"
tags:
- git
---

Do you want to have your main branch named to <strong>main</strong> instead of deprecated <strong>master</strong>? Not problem at all. You should check how you named your remote repo(s), it's usually called <strong>origin</strong>. You can check it:

```git
```bash
git remotes
```

And now you are ready to go:

```git
```bash
git branch -m master main
git push -u origin main
git push origin --delete master
Expand All @@ -25,12 +25,16 @@ git push origin --delete master

Do you see this error message?

``` bash
```bash
! [remote rejected] master (deletion of the current branch prohibited)
```

Alright, you have to set the main branch in your remote GIT repository.

![Bitbucket setup](./bitbucket-setup.png)

And don't forget to set the default branch in your local GIT repository:

```bash
git config --global init.defaultBranch main
```

0 comments on commit c3fc88c

Please sign in to comment.