SKILL更新
This commit is contained in:
parent
4b4f0a6a33
commit
1e3cfc050c
@ -267,11 +267,29 @@ D:\datasource\git\bin\git.exe -C D:\workspace\likei-services push origin {branch
|
|||||||
- **新建文件**:必须用 `Filesystem:write_file`,`edit_file` 只能操作已存在的文件,对新路径会报 ENOENT。
|
- **新建文件**:必须用 `Filesystem:write_file`,`edit_file` 只能操作已存在的文件,对新路径会报 ENOENT。
|
||||||
- **编辑已有文件**:优先用 `Filesystem:edit_file`;遇到编码匹配失败时改用 `Desktop Commander:write_file`(rewrite 模式,超过 30 行分块写入)。
|
- **编辑已有文件**:优先用 `Filesystem:edit_file`;遇到编码匹配失败时改用 `Desktop Commander:write_file`(rewrite 模式,超过 30 行分块写入)。
|
||||||
|
|
||||||
### git commit 中文 message 报错(cmd 下空格或中文被拆分为多个参数)
|
### git commit 报错(cmd 下 -m 后内容被拆分为多个参数)
|
||||||
必须切换到 PowerShell,用单引号包裹:
|
|
||||||
```powershell
|
**根本原因**:在 cmd 下直接执行 `git commit -m "message with spaces"` 时,cmd 会将双引号内的空格当作参数分隔符,导致 message 被拆成多个 pathspec 参数报错。无论是否含中文,只要 message 含空格就会出错。
|
||||||
& 'D:\datasource\git\bin\git.exe' -C 'D:\workspace\likei-services' commit -m 'english only'
|
|
||||||
|
**正确做法(必须严格遵守)**:
|
||||||
|
1. add 用 cmd + 完整 git 路径 + `-C` 指定仓库:
|
||||||
|
```cmd
|
||||||
|
D:\datasource\git\bin\git.exe -C D:\workspace\likei-services add {相对路径}
|
||||||
```
|
```
|
||||||
|
2. commit **必须**切换到 PowerShell,用单引号包裹 message,且只用英文:
|
||||||
|
```powershell
|
||||||
|
& 'D:\datasource\git\bin\git.exe' -C 'D:\workspace\likei-services' commit -m 'feat: add xxx'
|
||||||
|
```
|
||||||
|
3. commit 完成后用 cmd 确认 hash:
|
||||||
|
```cmd
|
||||||
|
D:\datasource\git\bin\git.exe -C D:\workspace\likei-services log --oneline -1
|
||||||
|
```
|
||||||
|
|
||||||
|
**禁止行为**:
|
||||||
|
- ❌ 禁止在 cmd 下执行 `git commit -m "有空格的message"`
|
||||||
|
- ❌ 禁止用 `cd /d xxx && git commit`(PATH 中的 git 不保证可用)
|
||||||
|
- ❌ 禁止省略 `-C D:\workspace\likei-services`(依赖 cwd 不可靠)
|
||||||
|
- ✅ commit message 必须用中文,PowerShell 单引号包裹中文没有问题
|
||||||
|
|
||||||
### git show 无输出(exit 0)
|
### git show 无输出(exit 0)
|
||||||
说明 hash 是最新提交,HEAD 和它相同,改用:
|
说明 hash 是最新提交,HEAD 和它相同,改用:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user