|
5 | 5 | - branch:分支
|
6 | 6 | - commit:提交记录
|
7 | 7 | - merge:指 PR 合并到代码仓库的操作
|
8 |
| -- conflicts:合并冲突 |
| 8 | +- conflicts:(合并)冲突 |
9 | 9 |
|
10 | 10 | ## 开始之前
|
11 |
| -1. 首先,fork 一下 [challenges](https://github.com/FreeCodeCampChina/challenges/pulls) repo |
| 11 | +1. 首先,fork 一下 [challenges](https://github.com/FreeCodeCampChina/challenges.git) repo |
12 | 12 | 2. 把**你的 fork** 克隆到本地。注意,`your_name` 是你的 github ID:
|
13 | 13 | ```bash
|
14 | 14 | git clone https://github.com/your_name/challenges.git
|
@@ -43,40 +43,31 @@ git push origin your_branch_name
|
43 | 43 | 9. 打开 github 页面,创建 PR
|
44 | 44 |
|
45 | 45 | ## 同步远程更新至本地
|
46 |
| -1. 关联上游 repo 至本地项目。注意,`upstream` 只是一个本地的 reference,你可以根据自己的习惯命名: |
| 46 | +1. 关联上游 repo 至本地项目: |
47 | 47 | ```bash
|
48 | 48 | git remote add upstream https://github.com/FreeCodeCampChina/challenges.git
|
49 | 49 | ```
|
50 |
| -2. 获取上游更新,并应用到本地。以下提供三种方式: |
51 |
| - 1. 使用 pull 命令: |
52 |
| - ```bash |
53 |
| - git pull upstream translate |
54 |
| - ``` |
55 |
| - 2. 使用 rebase 命令: |
56 |
| - ```bash |
57 |
| - git fetch upstream |
58 |
| - git rebase upstream/translate |
59 |
| - ``` |
60 |
| - 3. 使用 pull 命令与 rebase flag(推荐): |
61 |
| - ```bash |
62 |
| - git pull --rebase upstream translate |
63 |
| - ``` |
| 50 | +2. 获取上游更新,并应用到本地: |
| 51 | +```bash |
| 52 | +git pull --rebase upstream translate |
| 53 | +``` |
64 | 54 |
|
65 | 55 | ## 注意
|
66 |
| -1. `pull` 或 `rebase` 之后,如果有 conflicts,可以先使用 `git status` 查看存在 conflicts 的文件。修改成需要的版本后: |
67 |
| - - 如果你使用了 `pull` 命令,你需要 `git add .` 然后 `git commit` |
68 |
| - - 如果你使用了 `rebase` 或 `pull --rebase` 命令,你需要 `git add .` 然后 `git rebase --continue` |
| 56 | +1. `pull` 或 `rebase` 之后,如果有 conflicts,可以先使用 `git status` 查看存在 conflicts 的文件。修改成需要的版本后,使用 `git add .` 然后 `git rebase --continue` |
69 | 57 | 2. 解决冲突之后,需要更新至远程,否则只有你的本地有更新:
|
70 | 58 | ```bash
|
71 | 59 | git push origin your_branch_name
|
72 | 60 | ```
|
73 |
| -3. 如果出现错误提示(多出现于 `rebase` 和 `pull` 命令),请先使用 `git status` 命令检查本地是否有未解决完成的 conflicts |
74 |
| -4. 如果你已经用当前的 branch 开了 PR,那么更新这个 branch 至远程的同时,你的 PR 也会自动更新 |
| 61 | +3. 如果出现错误提示,请先使用 `git status` 命令检查本地是否有未解决完成的 conflicts |
| 62 | +3. 任何时候出现错误,不必惊慌。先使用 `git status` 命令检查当前所在的分支、当前目录是否纯净(clean),以及本地是否有未解决完成的 conflicts |
| 63 | +4. 如果上一步没问题,你可以用 `git push -f origin your_branch_name` 来更新远程 |
| 64 | +5. 如果你已经用当前的 branch 开了 PR,那么更新这个 branch 至远程的同时,你的 PR 也会自动更新 |
75 | 65 |
|
76 | 66 | ## 一些原则
|
77 |
| -1. 建议使用 [git workflow](https://guides.github.com/introduction/flow/) 来进行分支的管理。这样我们可以提交 PR 之后继续在新的 branch 上进行后续的翻译。若需要更新当前的 PR,任何时候我们都可以切换回来 |
| 67 | +1. 建议使用 [git workflow](https://guides.github.com/introduction/flow/) 来进行分支的管理。这样我们可以提交 PR 之后继续在新的 branch 上进行后续的翻译。若需要更新当前的 PR,我们随时可以切换回来 |
78 | 68 | 2. 不建议同时开两个相同类型(比如翻译)的 PR,请等待之前的 merge 之后再开新的 PR
|
79 |
| -3. 更新(创建)PR 时,请更新 labels,方便管理 |
| 69 | +3. 如果你的 PR 已经被 review 过,请不要再添加新的翻译内容,根据 comment 修改好当前的 PR 即可。后续的翻译你可以等当前翻译 merge 后再开始做,或者在另一个本地的 branch 进行后续的翻译 |
| 70 | +4. 更新(创建)PR 时,请更新 labels,方便管理 |
80 | 71 |
|
81 | 72 | ## 标签(labels)
|
82 | 73 | 1. `ready for review`:新开 PR 的默认状态,请手动添加此标签
|
|
0 commit comments