跳到主要内容
学院
初级 代码街区

Git 与 GitHub

保存、分支、合并,与他人协作写代码。

Git keeps every version of your work, lets you try ideas without fear, and lets a whole team build one project together. GitHub is where those teams review and ship their code. This track starts with your very first commit and ends with the workflow professional teams follow every day: a branch for each change, a pull request, a code review, green CI checks on a protected main branch, and an automatic deploy right after the merge.

Along the way you will read history like a detective, resolve conflicts calmly, undo mistakes without losing work, and learn exactly which commands rewrite history and when that is dangerous.

课时
19
时长
2 小时
级别
初级

本课程的内容目前为英文。

  • 铜牌 可挑战
  • 银牌 可挑战
  • 金牌 未解锁

准备好证明自己了吗?

三场考试正等着你:铜牌、银牌和金牌。

前往考试

学完后你将能够

  • Save work in small, clearly described commits and read any project's history
  • Create branches, merge them and resolve conflicts calmly
  • Keep your repository in sync with GitHub using clone, fetch, pull and push
  • Ship changes through pull requests, code review and required CI checks
  • Undo almost any mistake safely with restore, revert, reset and the reflog
  • Use stash, worktrees, rebase and tags the way experienced developers do

学习旅程

  1. 1
    第 1 单元

    First steps

    What version control is, how Git differs from GitHub, and your first repository and commit.

    0 / 3
  2. 2
    第 2 单元

    History and clean commits

    Read the log, compare versions with diff, and decide what belongs in a commit and what Git should ignore.

    0 / 3
  3. 3
    第 3 单元

    Branches and merging

    Work on several ideas at once, bring them together with merge, and resolve conflicts without panic.

    0 / 4
  4. 4
    第 4 单元

    Teamwork on GitHub

    Remotes, fetch, pull and push, then pull requests, code review, CI checks and protected branches.

    0 / 3
  5. 5
    第 5 单元

    Undo without fear

    Discard, unstage, amend, revert and reset safely, rescue lost commits with the reflog, and park work with stash and worktrees.

    0 / 3
  6. 6
    第 6 单元

    Rebase and releases

    Replay commits with rebase, tidy them with interactive rebase, follow the golden rule, and mark releases with tags.

    0 / 3

快速导航