Repository navigation
docs: 完善 Git 入门与贡献协作指南 - #20
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
原
Git 入门页面只有少量基础命令,尚未覆盖安装、首次身份配置、工作区与暂存区、分支协作、Fork、Pull Request 和安全恢复。原如何贡献页面同时存在旧个人仓库地址与截图、强制 root/SSH 流程、git add .、非快进同步以及 npm/pnpm 混用等问题,新贡献者按顺序操作时容易卡住或夹带无关改动。本 PR 将两页整理为一条面向零基础学生和 SCSWiki 贡献者的完整、安全且可按顺序执行的协作路径。
主要修改
1. 扩展 Git 入门页
add / commit / push / PR的边界;status → diff → 精确暂存 → staged diff → commit的安全工作流;origin / upstream、--ff-only同步、推送和创建/更新 PR;git revert、危险命令警示、常见报错和完成自查;verified,并加入 Git、Pro Git 和 GitHub 官方来源。2. 重写贡献协作流程
CWNU-Open-Source-Community/SCSWiki,移除仍指向旧个人仓库的过时截图;YOUR-USERNAME、实际文件路径和任务分支都需要替换,避免把占位内容直接复制到终端;>=20.11.0、Corepack、仓库锁定的 pnpm9.15.4、依赖安装和pnpm dev;Ctrl+C停止;git merge --ff-only、明确文件暂存和git diff --staged,不再把git add .作为默认流程;3. 更新入口与移动端元信息
<=640px的 ContentMeta 卡片增加紧凑两列布局;安全与变更边界
docs/development/git-basics.mddocs/development/index.mddocs/about/contribute.mddocs/.vitepress/theme/custom.cssmain、强制推送、使用 root 运行项目命令或在远程地址中保存令牌;--ff-only在本地main已分叉时会主动失败,这是避免意外合并提交的保护行为。验证
本地已完成:
pnpm typecheckpnpm lint:md(110 个 Markdown 文件,0 错误)pnpm validate:content(100 个 Markdown 文件)pnpm check:materials(86 个资料文件)pnpm check:links(100 个 Markdown 文件)pnpm test(6 个测试文件、24 项测试)pnpm buildpnpm check)生产构建仅保留仓库已有的“大于 500 kB chunk”警告,没有新增构建错误。
风险与回滚
改动集中在文档和
<=640px的 ContentMeta 样式,不影响桌面布局或站点数据。若需要回滚,可直接 revert 本 PR 的文档提交;无数据迁移或额外清理步骤。