Skip to content

Commit c3cd14c

Browse files
committed
Add guide: Rename default branch to main
1 parent f2ecd94 commit c3cd14c

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

docs/pages/guides/main-branch.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Rename default branch to `main`
2+
3+
The standard default branch name is `main` for all projects. Follow the steps below to update older projects using `master` branch.
4+
5+
It can be done in the GitHub repository, under Settings -> Default branch.
6+
7+
- https://github.com/TangibleInc/example-plugin/settings
8+
9+
After the switch, it also requires a change in any locally cloned repo.
10+
11+
```sh
12+
git checkout master
13+
git branch -m master main
14+
git fetch origin
15+
git branch --unset-upstream
16+
git branch -u origin/main
17+
```

docs/pages/guides/plugin-upgrade.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Rename main branch from "master" to "main".
4747
git branch -M main
4848
```
4949

50+
For existing projects, see the guide [Rename default branch to `main`](main-branch).
51+
5052
Push to remote `origin`, setting it as the upstream of main branch.
5153

5254
```sh

docs/sidebars.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ const sidebars: SidebarsConfig = {
145145
type: 'doc',
146146
id: 'guides/plugin-upgrade',
147147
},
148+
{
149+
type: 'doc',
150+
id: 'guides/main-branch',
151+
},
148152
{
149153
type: 'doc',
150154
id: 'guides/github-pages',

0 commit comments

Comments
 (0)