Skip to content

Commit

Permalink
[Docs] Rename master to main (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzaida authored Oct 18, 2023
1 parent 7495b33 commit c65187c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
12 changes: 6 additions & 6 deletions docs/en/notes/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ git commit -m "xxx" --no-verify

### 3. Create a development branch

After configuring the pre-commit, we should create a branch based on the master branch to develop the new feature or fix the bug. The proposed branch name is `username/pr_name`
After configuring the pre-commit, we should create a branch based on the main branch to develop the new feature or fix the bug. The proposed branch name is `username/pr_name`

```shell
git checkout -b yhc/refactor_contributing_doc
```

In subsequent development, if the master branch of the local repository is behind the master branch of "upstream", we need to pull the upstream for synchronization, and then execute the above command:
In subsequent development, if the main branch of the local repository is behind the main branch of "upstream", we need to pull the upstream for synchronization, and then execute the above command:

```shell
git pull upstream master
git pull upstream main
```

### 4. Commit the code and pass the unit test
Expand Down Expand Up @@ -161,18 +161,18 @@ MMEngine will run unit test for the posted Pull Request on different platforms (

### 7. Resolve conflicts

If your local branch conflicts with the latest master branch of "upstream", you'll need to resolove them. There are two ways to do this:
If your local branch conflicts with the latest main branch of "upstream", you'll need to resolove them. There are two ways to do this:

```shell
git fetch --all --prune
git rebase upstream/master
git rebase upstream/main
```

or

```shell
git fetch --all --prune
git merge upstream/master
git merge upstream/main
```

If you are very good at handling conflicts, then you can use rebase to resolve conflicts, as this will keep your commit logs tidy. If you are not familiar with `rebase`, then you can use `merge` to resolve conflicts.
Expand Down
19 changes: 11 additions & 8 deletions docs/zh_cn/notes/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,16 @@ pre-commit run --all-files

<img src="https://user-images.githubusercontent.com/57566630/202368856-0465a90d-8fce-4345-918e-67b8b9c82614.png" width="1200">

```{note}
:::{note}
如果你是中国用户,由于网络原因,可能会出现安装失败的情况,这时可以使用国内源
pre-commit install -c .pre-commit-config-zh-cn.yaml

```bash
pre-commit run --all-files -c .pre-commit-config-zh-cn.yaml
```

如果安装过程被中断,可以重复执行 `pre-commit run ...` 继续安装。
:::

如果安装过程被中断,可以重复执行 `pre-commit run --all-files` 继续安装。

如果提交的代码不符合代码风格规范,pre-commit 会发出警告,并自动修复部分错误。

Expand All @@ -97,16 +100,16 @@ git commit -m "xxx" --no-verify

### 3. 创建开发分支

安装完 pre-commit 之后,我们需要基于 master 创建开发分支,建议的分支命名规则为 `username/pr_name`
安装完 pre-commit 之后,我们需要基于 main 创建开发分支,建议的分支命名规则为 `username/pr_name`

```shell
git checkout -b yhc/refactor_contributing_doc
```

在后续的开发中,如果本地仓库的 master 分支落后于 upstream 的 master 分支,我们需要先拉取 upstream 的代码进行同步,再执行上面的命令
在后续的开发中,如果本地仓库的 main 分支落后于 upstream 的 main 分支,我们需要先拉取 upstream 的代码进行同步,再执行上面的命令

```shell
git pull upstream master
git pull upstream main
```

### 4. 提交代码并在本地通过单元测试
Expand Down Expand Up @@ -176,14 +179,14 @@ MMEngine 会在不同的平台(Linux、Window、Mac),基于不同版本的

```shell
git fetch --all --prune
git rebase upstream/master
git rebase upstream/main
```

或者

```shell
git fetch --all --prune
git merge upstream/master
git merge upstream/main
```

如果你非常善于处理冲突,那么可以使用 rebase 的方式来解决冲突,因为这能够保证你的 commit log 的整洁。如果你不太熟悉 `rebase` 的使用,那么可以使用 `merge` 的方式来解决冲突。
Expand Down

0 comments on commit c65187c

Please sign in to comment.