Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/steps/-step.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
4
1 change: 1 addition & 0 deletions PROFILE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Welcome to my GitHub profile!
60 changes: 21 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,39 @@ _我们将在不到一小时的时间内学习如何使用GitHub_
</header>

<!--
<<< Author notes: Step 1 >>>
Choose 3-5 steps for your course.
The first step is always the hardest, so pick something easy!
Link to docs.github.com for further explanations.
Encourage users to open new tabs for steps!
<<< Author notes: Step 4 >>>
Just a historic note: The previous version of this step required responding
to a pull request review before merging. The previous version also handled
if users accidentally closed without merging.
-->

## Step 1: 新建分支
## Step 4: 合并 Pull Request

_欢迎来到 "GitHub 入门课程"! :wave:_
_你已经创建了 Pull Request,做得很好! :sunglasses:_

**什么是GitHub**: GitHub 是一个使用 _[Git](https://docs.github.com/get-started/quickstart/github-glossary#git)_ 进行版本控制和协作的代码托管平台,是一个分享和贡献开源软件的流行平台。
Pull Request 的意义在于让他人有机会在代码合并到主分支之前,先审查并提出意见。
当所有讨论完成并确认无误后,就可以将这个分支的修改正式合并进主分支。

📺 可以看看这段 Youtube 介绍视频:[什么是 GitHub?](https://www.youtube.com/watch?v=pBy1zgt0XPc)
**什么是合并(merge)?**: [合并(merge)](https://docs.github.com/en/get-started/quickstart/github-glossary#merge)_ 的过程,就是把你分支上的改动整合进 main 分支。
一旦合并完成,你的修改就会成为主分支的一部分。更多详细说明可参阅 "[Merging a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request)"。

**什么是仓库(Repository)?**:_[仓库](https://docs.github.com/get-started/quickstart/github-glossary#repository)_ 是 GitHub 最核心的元素。一个仓库就像一个项目文件夹,里面包含所有项目文件(包括文档),并存储每个文件的修改历史记录。 仓库可以有多个协作者,仓库可以是公开的,也可以设置为私有的。欲了解更多信息,请查看 GitHub 文档中的"[关于仓库](https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories)"。
在上一步中,你可能注意到 GitHub Actions 在后台运行,它会自动帮你推进课程进度。
当合并按钮变成绿色时(如下图),就表示可以进行合并操作了。

![screenshot of green merge pull request button](/images/Green-merge-pull-request.png)

**什么是分支(Branch)?**: _[分支](https://docs.github.com/en/get-started/quickstart/github-glossary#branch)_ 是您仓库的并行版本。每个仓库在创建时都有一个默认主分支,通常叫 `main`,它代表项目的主线版本。
### :keyboard: 实操环节: Merge the pull request

创建新的分支可以让你从 main 复制一份独立的副本,方便修改、测试或开发新功能,而不会影响主项目。
许多人会为特定功能开独立分支,这样可以在不干扰他人的情况下进行开发。
1. 点击 **Merge pull request**
2. 点击 **Confirm merge**,确认合并
3. 当分支成功合并到 `main` 后,这个分支就没用了,你可以点击 Delete branch 将其删除。

使用分支的好处是,你的修改和主分支是隔离的 —— 换句话说,每个人的工作都能保持安全。
更多介绍请看文档:[关于分支](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches)。
![screenshot showing delete branch button](/images/delete-branch.png)

**什么是 Profile README?**: _[Profile README](https://docs.github.com/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme)_ 是 GitHub 个人主页上的自我介绍部分。你可以在这里展示自己的信息、项目或兴趣。
GitHub 会把它显示在你个人主页的顶部。更多内容可参考 "[管理个人资料自述文件](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme)".
4. 等待大约20秒,然后刷新当前课程页面。[GitHub Actions](https://docs.github.com/en/actions) 会自动检测并进入下一步。

![profile-readme-example](/images/profile-readme-example.png)

### :keyboard: 实操环节:创建你的第一个分支

1. 打开一个新的浏览器标签页,进入你刚创建的仓库。保持这个页面不关,边看步骤边操作。
2. 在仓库顶部导航栏中,点击 **< > Code** 选项。

![code-tab](/images/code-tab.png)

3. 点击 **main** 分支的下拉菜单。

![main-branch-dropdown](/images/main-branch-dropdown.png)

4. 在输入框中输入新分支名 `my-first-branch`。注意:必须使用这个名字,才能触发课程后续流程。

5. 点击 **Create branch: my-first-branch** 按钮来创建分支。

![create-branch-button](/images/create-branch-button.png)

创建后,你的仓库会自动切换到这个新分支,下拉菜单中也会显示出 `my-first-branch`。

6. 等待大约20秒,然后刷新当前课程页面。[GitHub Actions](https://docs.github.com/en/actions) 会自动检测并进入下一步。
> [!NOTE]
> 在下一步的 **Finish** 步骤你可以看到本教程的总结和后续建议,了解更多可学习的内容。

<footer>

Expand Down