# 把 easyppt 上传到 GitHub(零基础指南) 本指南面向**第一次使用 GitHub** 的用户,用 Windows + PowerShell 逐步操作。 目标:把 `C:\Users\admin\Desktop\easyppt` 上传到 GitHub,让别人能 `dsh plugin --profile web add https://github.com/<你的用户名>/easyppt` 直接安装。 --- ## 第 0 步:准备(一次性) ### 0.1 注册 GitHub 账号 1. 打开 https://github.com 点击 **Sign up**。 2. 填邮箱(必须是有效邮箱)、密码、用户名(`<你的用户名>` 就是你注册的名字,比如 `zhangsan`)。 3. 按提示完成验证,**去邮箱点确认链接**。不确认邮箱无法建仓库。 ### 0.2 安装 Git 你的电脑上**还没有 git**(我检查过 `git --version` 报错)。 1. 打开 https://git-scm.com/download/win 下载安装包(64-bit)。 2. 双击安装,一路 **Next**,到 "Adjusting your PATH environment" 那一步: 保持默认 **Git from the command line and also from 3rd-party software**,继续 Next 到 Finish。 3. **重新打开一个 PowerShell 窗口**,输入 `git --version`,能看到版本号即安装成功。 > 提示:也可以让我用 `winget install Git.Git` 帮你装(需要你确认授权)。 --- ## 第 1 步:在 GitHub 上创建空仓库 1. 登录 GitHub,点右上角 **+** → **New repository**(或 https://github.com/new )。 2. 填写: - **Repository name**:`easyppt`(必须小写) - **Description**(可选):`Automated PPT generation dsh-plugin for DeepSeek Harness` - 选择 **Public**(公开,别人才能装) - **不要**勾选 "Add a README file"、"Add .gitignore"、"Choose a license"(项目里已有,避免冲突) 3. 点绿色 **Create repository**。 创建后会看到一页 "quick setup" 页面,**先别关**,第 3 步要用里面的地址。 --- ## 第 2 步:在本地初始化 git 并配置身份(只做一次) 打开 PowerShell,进入项目目录: ```powershell cd C:\Users\admin\Desktop\easyppt ``` 配置你的身份(用户名/邮箱换成你自己的,跟 GitHub 一致即可): ```powershell git config --global user.name "你的GitHub用户名" git config --global user.email "你注册GitHub用的邮箱" ``` 初始化仓库并提交: ```powershell git init git branch -M main git add . git status # 检查:node_modules / demo / .easyppt 应已被 .gitignore 排除 git commit -m "feat: easyppt dsh-plugin — automated PPT generation for DeepSeek Harness" ``` > 如果 `git commit` 报 "Please tell me who you are",说明第 2 步身份没配好,重跑那两条 config。 --- ## 第 3 步:关联远程仓库并推送 在 GitHub 那个 "quick setup" 页面上,复制 **HTTPS** 地址 (形如 `https://github.com/你的用户名/easyppt.git`),然后: ```powershell git remote add origin https://github.com/你的用户名/easyppt.git git push -u origin main ``` ### 第一次推送要登录 - 浏览器会弹出 GitHub 登录窗口 → 登录即可(Git 凭据管理器会记住)。 - 如果你开了**两步验证(2FA)**,密码框要填 **Personal Access Token (PAT)** 而不是登录密码: 1. GitHub 右上角头像 → **Settings** → 最下面 **Developer settings** → **Personal access tokens** → **Tokens (classic)** → **Generate new token**; 2. 勾选 `repo` 权限,点生成,**复制**那串 `ghp_...`; 3. 回到推送时的密码框,粘贴 `ghp_...` 即可。 推送成功后,刷新 GitHub 仓库页面就能看到全部文件了。 --- ## 第 4 步:打上 `dsh-plugin` 标签(Topics) 1. 打开仓库页面(`https://github.com/你的用户名/easyppt`)。 2. 右侧栏找到 **About** 区块的齿轮 ⚙ → **Edit repository details**(或直接点 **Topics**)。 3. 在 **Topics** 输入 `dsh-plugin`,回车,再点 **Save changes**。 --- ## 第 5 步(可选):发布 Release(推荐) 打一个版本 tag,别人可以用带版本的 URL 安装,也便于以后更新: 1. 仓库页面右侧栏 **Releases** → **Create a new release**。 2. **Choose a tag** 输入 `v0.1.0` → **Create new tag**。 3. 标题写 `v0.1.0`,说明写一句 `Automated PPT generation for DeepSeek Harness`。 4. 点 **Publish release**。 --- ## 以后更新代码(常用) ```powershell cd C:\Users\admin\Desktop\easyppt git add -A git commit -m "描述这次改了什么" git push ``` ## 下载到别处 / 别人安装 ```powershell dsh plugin --profile web add https://github.com/你的用户名/easyppt ``` --- ## 常见问题 | 现象 | 解决 | | --- | --- | | `git` 不是内部或外部命令 | 没装好 Git,或装的时候没选 "Git from the command line";重装时选上,或重开 PowerShell | | `push` 被拒绝(rejected) | 远程有新提交。先 `git pull origin main --rebase`,再 `git push` | | 提交时提示 CRLF 警告 | 无害,忽略即可(想消除可加 `.gitattributes`) | | 不小心提交了 node_modules | 已用 `.gitignore` 排除;若已提交过,删除缓存:`git rm -r --cached node_modules` 后重新 commit | | 想把 demo 演示文件也放上 GitHub 展示 | 编辑 `.gitignore` 去掉 `demo/` 那一行,再 `git add -A && git commit -m "add demo" && git push`(demo 里的图片可作 README 配图) | | 忘了 GitHub 密码 / 用 PAT 报错 | 确认 token 勾了 `repo` 权限且未过期;Token 只显示一次,丢了就重新生成 |