memo001_github_v3 — GitHub Knowledge Tree / GitHub 知识树
Version: 3.0 | Audience / 读者: Beginner and professional / 初学者与专业读者
Purpose / 目的: Learn the minimum practical Git/GitHub concepts through an atomic, bilingual knowledge tree. / 通过中英双语原子化知识树学习 Git/GitHub 核心操作。
Prerequisites / 前提: Git installed; GitHub account for remote exercises; terminal and text editor. / 安装 Git;远程操作需要 GitHub 账号;准备终端和编辑器。
Reading guide / 阅读方式: Read each node's professional definition, plain-language explanation, procedure, instance, and typed relationship. / 依次阅读专业定义、通俗解释、操作、实例与关系。
Authentication / 身份验证: For HTTPS Git operations, use Git Credential Manager, an approved credential helper, or GitHub CLI (gh auth login); a GitHub account password is not used as an HTTPS Git password. Never put tokens in commands, URLs, or memo files. / HTTPS Git 操作应使用凭据管理器或 gh auth login,不要将令牌写进命令或文件。
Source status / 来源状态: Official documentation links are provided for each node; this revision does not claim live verification of every current UI label. / 每个节点附官方文档链接;本版不声称已实时核实所有网页按钮名称。
Knowledge tree / 知识树
1 Git → 1.1 GitHub
2 Repository → 2.1 Remote; 2.2 Clone
3 Working Tree → 3.1 Staging Area → 3.2 Commit
4 Branch
5 Synchronization → 5.1 Push; 5.2 Fetch; 5.3 Pull
6 Pull Request → 6.1 Code Review
7 Merge → 7.1 GitHub Merge; 7.2 Merge Conflict
8 Issue
9 README → 9.1 Markdown
10 Fork
11 GitHub Actions
1 Git
Concept · Professional / 专业: Distributed version control system.
Plain-language / 通俗: 分布式版本控制系统,记录文件的历史变化。
Procedure / 操作: git --version
Instance / 实例: Check that Git is installed. / 确认 Git 已安装。
Relationship / 关系: contrasts-with → GitHub.
Official reference / 官方资料: https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F
1.1 GitHub
Concept · Professional / 专业: A hosting and collaboration platform for Git repositories.
Plain-language / 通俗: 托管 Git 仓库并支持协作的平台。
Procedure / 操作: Open https://github.com and sign in.
Instance / 实例: Create an account to collaborate. / 注册账号以便协作。
Relationship / 关系: hosts → Repository.
Official reference / 官方资料: https://docs.github.com/en/get-started/start-your-journey/about-github-and-git
2 Repository
Concept · Professional / 专业: A project directory with Git-tracked history.
Plain-language / 通俗: 包含 Git 版本历史的项目目录。
Procedure / 操作: git init demo && cd demo
Instance / 实例: Start a local project. / 建立本地项目。
Relationship / 关系: contains → Working Tree; history → Commit.
Official reference / 官方资料: https://git-scm.com/docs/git-init
2.1 Remote
Concept · Professional / 专业: A named reference to another repository location.
Plain-language / 通俗: 指向其他仓库位置的命名引用。
Procedure / 操作: git remote -v
Instance / 实例: Inspect configured remotes. / 检查远程仓库。
Relationship / 关系: connects → local Repository and GitHub Repository.
Official reference / 官方资料: https://git-scm.com/docs/git-remote
2.2 Clone
Concept · Professional / 专业: Copies a repository and configures a remote, typically origin.
Plain-language / 通俗: 复制仓库并通常配置 origin 远程地址。
Procedure / 操作: git clone https://github.com/OWNER/REPO.git
Instance / 实例: Copy a repository locally. / 将仓库复制到本地。
Relationship / 关系: creates → local Repository; configures → Remote.
Official reference / 官方资料: https://git-scm.com/docs/git-clone
3 Working Tree
Concept · Professional / 专业: The files currently checked out for editing.
Plain-language / 通俗: 当前工作目录中可编辑的文件。
Procedure / 操作: git status
Instance / 实例: Inspect modified files. / 查看已修改文件。
Relationship / 关系: feeds → Staging Area.
Official reference / 官方资料: https://git-scm.com/docs/git-status
3.1 Staging Area
Concept · Professional / 专业: The index selecting changes for the next commit.
Plain-language / 通俗: 用于选择下一次提交内容的暂存区。
Procedure / 操作: git add README.md
Instance / 实例: Stage a specific file. / 暂存指定文件。
Relationship / 关系: precedes → Commit.
Official reference / 官方资料: https://git-scm.com/docs/git-add
3.2 Commit
Concept · Professional / 专业: A recorded snapshot of staged content and metadata.
Plain-language / 通俗: 记录暂存内容与元数据的版本快照。
Procedure / 操作: git commit -m "Document setup"
Instance / 实例: Save a traceable change. / 保存可追溯的更改。
Relationship / 关系: records → Staging Area; belongs-to → Branch history.
Official reference / 官方资料: https://git-scm.com/docs/git-commit
4 Branch
Concept · Professional / 专业: A movable pointer to a line of development.
Plain-language / 通俗: 指向某条开发历史的可移动引用。
Procedure / 操作: git switch -c docs-update
Instance / 实例: Work independently. / 在独立分支上修改。
Relationship / 关系: points-to → Commit; enables → Pull Request.
Official reference / 官方资料: https://git-scm.com/docs/git-branch
5 Synchronization
Concept · Professional / 专业: The family of operations connecting local and remote history.
Plain-language / 通俗: 协调本地与远程历史的一组操作。
Procedure / 操作: git remote -v
Instance / 实例: Identify the target remote first. / 先确认远程目标。
Relationship / 关系: contains → Push, Fetch, Pull.
Official reference / 官方资料: https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
5.1 Push
Concept · Professional / 专业: Uploads local refs and associated objects to a remote.
Plain-language / 通俗: 将本地引用及关联对象发送到远程。
Procedure / 操作: git push -u origin docs-update
Instance / 实例: Publish a branch. / 发布分支。
Relationship / 关系: sends-to → Remote.
Official reference / 官方资料: https://git-scm.com/docs/git-push
5.2 Fetch
Concept · Professional / 专业: Downloads remote refs and objects without merging into the current branch.
Plain-language / 通俗: 下载远程更新,但不自动合并进当前分支。
Procedure / 操作: git fetch origin
Instance / 实例: Inspect updates safely. / 先获取远程更新。
Relationship / 关系: precedes → Merge or Rebase.
Official reference / 官方资料: https://git-scm.com/docs/git-fetch
5.3 Pull
Concept · Professional / 专业: Fetches then integrates changes into the current branch, using merge or rebase as configured.
Plain-language / 通俗: 先获取远程更新,再按配置执行合并或变基。
Procedure / 操作: git pull --ff-only origin main
Instance / 实例: Update a clean local main branch. / 快进更新本地主分支。
Relationship / 关系: composes → Fetch + Integration (Merge/Rebase).
Official reference / 官方资料: https://git-scm.com/docs/git-pull
6 Pull Request
Concept · Professional / 专业: A GitHub proposal to review and integrate branch changes.
Plain-language / 通俗: GitHub 上用于审查并合入分支更改的提案。
Procedure / 操作: GitHub → Pull requests → New pull request
Instance / 实例: Request review of docs-update into main. / 提交文档修改供审查。
Relationship / 关系: compares → Branches; may lead-to → GitHub Merge.
Official reference / 官方资料: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
6.1 Code Review
Concept · Professional / 专业: A structured examination and discussion of proposed changes.
Plain-language / 通俗: 对拟议更改进行审查和讨论。
Procedure / 操作: Open a pull request → Files changed → Review changes
Instance / 实例: Suggest a correction. / 提出修订建议。
Relationship / 关系: part-of → Pull Request workflow.
Official reference / 官方资料: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews
7 Merge
Concept · Professional / 专业: Integrates histories or changes from separate branches.
Plain-language / 通俗: 将不同分支的历史或更改整合。
Procedure / 操作: git switch main && git merge docs-update
Instance / 实例: Integrate locally after review. / 审查后在本地合并。
Relationship / 关系: may cause → Merge Conflict.
Official reference / 官方资料: https://git-scm.com/docs/git-merge
7.1 GitHub Merge
Concept · Professional / 专业: Integrates a pull request through GitHub’s interface.
Plain-language / 通俗: 通过 GitHub 网页合并 Pull Request。
Procedure / 操作: Pull request → Merge pull request → Confirm merge
Instance / 实例: Merge an approved PR when permitted. / 在权限允许时合并已批准 PR。
Relationship / 关系: completes → Pull Request; updates → target Branch.
Official reference / 官方资料: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request
7.2 Merge Conflict
Concept · Professional / 专业: An unresolved overlap Git cannot integrate automatically.
Plain-language / 通俗: Git 无法自动处理的冲突更改。
Procedure / 操作: git status; edit conflict markers; git add FILE; git commit
Instance / 实例: Resolve a conflicting README edit. / 解决 README 的冲突编辑。
Relationship / 关系: interrupts → Merge; resolved-by → manual editing.
Official reference / 官方资料: https://git-scm.com/docs/git-merge
8 Issue
Concept · Professional / 专业: A GitHub item for tracking work, bugs, or discussion.
Plain-language / 通俗: GitHub 中用于跟踪任务、缺陷或讨论的条目。
Procedure / 操作: Repository → Issues → New issue
Instance / 实例: Track a documentation typo. / 记录文档错字。
Relationship / 关系: may link-to → Pull Request.
Official reference / 官方资料: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/about-issues
9 README
Concept · Professional / 专业: A project introduction and usage document, commonly README.md.
Plain-language / 通俗: 项目简介与使用说明,常用文件名 README.md。
Procedure / 操作: printf "# Demo\n" > README.md
Instance / 实例: Document project purpose. / 说明项目用途。
Relationship / 关系: is-file-in → Repository; often uses → Markdown.
Official reference / 官方资料: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes
9.1 Markdown
Concept · Professional / 专业: A lightweight plain-text markup syntax.
Plain-language / 通俗: 一种轻量级纯文本标记语法。
Procedure / 操作: printf "## Setup\n" >> README.md
Instance / 实例: Add a heading. / 添加标题。
Relationship / 关系: formats → README and Pull Request descriptions.
Official reference / 官方资料: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
10 Fork
Concept · Professional / 专业: A new repository under another account based on an existing repository.
Plain-language / 通俗: 在另一账号下创建基于原仓库的副本。
Procedure / 操作: GitHub repository → Fork → Create a new fork
Instance / 实例: Propose changes to a project without write access. / 无写入权限时提出修改。
Relationship / 关系: creates → separate Repository; supports → Pull Request.
Official reference / 官方资料: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks
11 GitHub Actions
Concept · Professional / 专业: GitHub automation for workflows such as tests and builds.
Plain-language / 通俗: 用于测试、构建等工作流的 GitHub 自动化服务。
Procedure / 操作: Repository → Actions → select a starter workflow
Instance / 实例: Run checks when a pull request opens. / PR 创建时自动检查。
Relationship / 关系: triggered-by → GitHub events; checks → Pull Request.
Official reference / 官方资料: https://docs.github.com/en/actions/about-github-actions/understanding-github-actions
End-to-end example / 端到端实例
从本地修改到 GitHub 合并查看大图
- Sign in to GitHub and create an empty repository named
demo-notes (optionally initialize with README). / 登录 GitHub,新建 demo-notes 仓库。
- Clone its HTTPS URL, replacing
OWNER with your account: git clone https://github.com/OWNER/demo-notes.git. / 克隆仓库。
cd demo-notes && git switch -c docs-update. / 创建文档分支。
- Edit
README.md; then git add README.md && git commit -m "Improve README". / 修改、暂存并提交。
- Authenticate safely (
gh auth login if GitHub CLI is installed, or configured credential manager), then git push -u origin docs-update. / 安全认证并推送。
- Open a pull request on GitHub targeting
main; review the diff and request review if needed. / 创建 PR 并审查。
- If authorized, merge on GitHub; otherwise wait for a maintainer. / 有权限时合并,否则等待维护者。
- Back locally:
git switch main && git pull --ff-only origin main. / 同步本地 main。
Safety / 安全: Do not force-push shared branches, commit secrets, or merge without required approvals. / 不要强推共享分支、提交密钥或绕过审批。
Self-check / 自测
- Why is a commit different from a push? / Commit 和 Push 有什么区别?
- What does fetch do that pull additionally changes? / Fetch 与 Pull 有何差异?
- When would you use a fork instead of a branch? / 何时使用 Fork 而不是 Branch?
- Compare GitHub merge and local merge. / 比较网页合并与本地合并。
- Explain the typed relationship: Pull = Fetch + Integration. / 解释 Pull 的组成关系。
Appendix A — AI traceability / AI 可追溯性
- Generator skill:
technical-concept-memo-generator v2 (included separately).
- Review skill:
technical-memo-reviewer v1 (included separately).
- Model: OpenAI GPT-6.
- Prompt / request: Optimize bilingual GitHub memo and generator skill according to Sid's review.
- Inputs:
memo001_github_v2_bilingual.md, SKILL.md, memo004_thoughts_ScarlettGIT.pdf (Sid review dated 2026-10-29).
- Outputs:
memo001_github_v3_bilingual.md, generator SKILL.md, reviewer SKILL.md.
- Human verification: Not yet performed for this revision. Sid's earlier review applies to v2.1, not approval of v3.
- Documentation verification: Links supplied to official references; live UI/command verification not completed in this run.
- Review status: Draft for human review.