docs: 记录中文 commit message 乱码修复经验(提交历史重写为 2c90205/4b3ea03/b11bea1)

This commit is contained in:
2026-08-23 11:39:23 +08:00
parent b11bea1962
commit 8df2f002d2
4 changed files with 12 additions and 1 deletions
+3 -1
View File
@@ -129,7 +129,8 @@ Get-CimInstance Win32_Process | Where CommandLine -like '*SmartAgriCenter*' | Fo
- 远程:`https://github.bbitcn.net/fanhongcai/DataViewCenter.git`
- **远程名是 `DataViewCenter`,不是 `origin`**`main` 已设上游跟踪 → 直接 `git push`
- 提交历史`68810be`init 全量)→ `682962e`(打包瘦身
- 提交历史2026-08-23 重写乱码信息后):`2c90205`init 全量)→ `4b3ea03`(打包瘦身)→ `b11bea1`(文档存档
- **⚠️ 提交信息防乱码**`git commit -m "中文"` 在本机会双编码乱码(GBK→UTF-8),**必须用 `git commit -F <utf8消息文件>`**
- `.gitignore` 忽略:node_modules / out / dist / release / 日志 / IDE
- `.codebuddy/memory/` 随仓库备份(跨会话记忆)
@@ -138,6 +139,7 @@ Get-CimInstance Win32_Process | Where CommandLine -like '*SmartAgriCenter*' | Fo
| 坑 | 解法 |
|---|---|
| PowerShell 中文路径乱码 | 命令用相对路径;先 cd 再执行;避免 `git -C`/直接写中文文件名 |
| **中文 commit message 乱码** | `git commit -m "中文"` 会双编码乱码(GBK→UTF-8)。**改用 `git commit -F <utf8消息文件>`**;已损坏的历史可用 Node 脚本 + `git hash-object -t commit -w` 保真重写(保留 author/committer/时间戳)再 force push |
| `npm run dist` 卡死/文件占用 | 挂死的 node/electron-builder 进程未退出 → 先杀进程再删 release(§4) |
| CodeBuddy 删除守卫拦截批量删除 | 用 `[System.IO.Directory]::Delete(dir,$true)` 或 `cmd /c "rd /s /q <dir>"` |
| electron 二进制缺失("Electron failed to install correctly" | `node node_modules/electron/install.js`;网络受限先 `$env:ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"` |