From ca8e4cdb36f9029a244640abc8996ba47af19f43 Mon Sep 17 00:00:00 2001 From: weishen Date: Tue, 15 Sep 2026 21:19:48 +0800 Subject: [PATCH] =?UTF-8?q?docs(git-sync):=20=E8=A1=A5=E5=85=85=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=89=A9=E7=9B=AE=E5=BD=95=EF=BC=88nexus=20translatio?= =?UTF-8?q?n=5Ftasks=EF=BC=89=E8=A2=AB=20add=20-A=20=E5=8D=B7=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E5=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git-sync/SKILL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/git-sync/SKILL.md b/git-sync/SKILL.md index cb2924b..0d10ace 100644 --- a/git-sync/SKILL.md +++ b/git-sync/SKILL.md @@ -78,4 +78,5 @@ metadata: - **`pull.rebase=true` 的仓库**(本机 nexus 即如此):有未暂存改动时 ff-only pull 必失败报 "cannot pull with rebase",哪怕与远端无文件重叠——先用 `git diff --name-only HEAD origin/main` 确认无重叠,再 `git -c pull.rebase=false pull --ff-only`,不必惊动用户。脚本遇此会自动打印 hint - **push 报 `could not read Username for 'http://'`**:远端是 HTTP 且本机无该 host 凭据(keychain 里存的端口对不上也照样失败)。同主机若跑了 Gitea SSH,改 `git remote set-url origin ssh://git@:2222//.git` 即可直推;改前先 `git ls-remote ` 验证有权限,改后 `git push` 并用 `git ls-remote origin refs/heads/main` 核对远端 hash - **`add -A` 会把未跟踪的大目录一并提交**(实测 node_modules 56MB / 5606 文件):`status` 里出现这类目录时先补 `.gitignore`(`node_modules/`、`.DS_Store`)再 sync,否则仓库历史被永久撑大 +- **生成物目录会被 `add -A` 一并提交**(实测 nexus 的 `sreweekly/translation_tasks/`:767 个 `task_XXXX.txt`/`meta.json` 流水线中间产物,且流水线跑完会自己删掉这批文件,导致「先提交、后全量删除」两个巨量提交):同步前先判断 status 里的新目录是成果还是中间产物,后者不要入库 - 脚本由其他技能/agent 复用时同样适用,别只当本技能专用 \ No newline at end of file