CodeRoadMap
首页路线题库资源库文章社区
CodeRoadMap

程序员的学习成长路线图。内容免费开放,登录后可同步路线图与课时进度。

由 程序员柏风 独立维护 · 关于作者

学习

  • 路线图
  • 课程
  • 面试题
  • 文章
  • 我

更多

  • 资源
  • 社区
  • 关于作者
  • 内容说明

© 2026 CodeRoadMap

津ICP备2026012044号-1·津公网安备12011002026155号·coderoadmap@126.com
GitHub 协作进阶/课时/综合练习
RawBlame
课时目录12 节

GitHub 协作进阶

  1. 01GitHub 路线图概览
  2. 02账号与 Profile
  3. 03仓库管理
  4. 04提交与历史
  5. 05分支与变基
  6. 06远程与 Fork
  7. 07Pull Request
  8. 08Issues 协作
  9. 09GitHub Actions
  10. 10组织与团队
  11. 11Pages 与静态站
  12. 12综合练习

综合练习

为开源仓库提 PR + 配 Actions CI。

40 分钟

综合练习

本课串联 git-github-essentials 全程:Fork → 分支 → commit → PR → Issue → Actions CI →(可选)Pages。对应 git-github 路线图 毕业节点。

前置:完成 git-essentials 与前面 11 课;CI 细节可查阅 github-actions-essentials。

学习目标

  • 独立完成一次对开源项目的 docs 类 PR
  • 在自己的练习仓配置 PR 触发的 CI
  • 对照路线图打勾全部 git-github 节点

练习 A:开源 Docs PR(推荐)

  1. 在 git-github 路线图 选一个 good first issue 或自行发现 docs typo 的仓库
  2. Fork → clone 你的 fork
  3. 开 Issue(可选):「fix typo in README line 42」
  4. 分支 + commit + push:
git clone git@github.com:YOU/upstream-project.git
cd upstream-project
git remote add upstream git@github.com:ORIGINAL/upstream-project.git
git switch -c docs/fix-readme-typo
# 编辑 README
git commit -m "docs: fix typo in installation section

Closes #YOUR_ISSUE_IF_ANY"
git push -u origin docs/fix-readme-typo
  1. 开 PR:填模板、等 CI、根据 review 修改
  2. 合并后 git fetch upstream && git switch main && git merge upstream/main

练习 B:自建练习仓 + CI

在 personal 或 org 仓完成:

# .github/workflows/pr-check.yml
name: PR Check

on:
  pull_request:
    branches: [main]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "Replace with real lint/test for your stack"
      - run: test -f README.md
git switch -c chore/add-pr-workflow
git add .github/workflows/pr-check.yml
git commit -m "ci: add PR check workflow"
git push -u origin chore/add-pr-workflow
# 开 PR,确认 Checks 运行

Settings → Branches 为 main 开启 Require status checks。

练习 C:Pages 小站(可选)

在练习仓 docs/ 放:

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="utf-8"><title>Git GitHub Practice</title></head>
<body>
  <h1>git-github-essentials 毕业页</h1>
  <p>路线图:<a href="/roadmaps/git-github">/roadmaps/git-github</a></p>
</body>
</html>

启用 Pages 后访问 URL 自检。

自检清单

  • Profile 有 README,SSH 可用
  • 会 fork / upstream 同步
  • commit message 符合 conventional 风格
  • 至少 1 个 merged 或 open 的 PR(含描述与 diff review)
  • 用过 Labels / Closes #issue
  • Actions 在 PR 上跑通过或见过失败日志
  • /roadmaps/git-github 全部节点打勾

继续深入

方向链接
Actions 深入github-actions-essentials
Git 命令复习git-essentials
全栈路线图/roadmaps/full-stack

小结

毕业标准 = 真实 PR + 基本 CI + 路线图闭环。 恭喜完成 GitHub 协作进阶 track;接下来在团队项目或开源社区持续实践。

加载本节练习…
← 上一课Pages 与静态站