feat: 快速提交 - 周一 2025/09/22 13:18:51.04

This commit is contained in:
赵杰 Jie Zhao (雄狮汽车科技)
2025-09-22 13:18:51 +01:00
parent 91a86a1f4f
commit 8176caa338
3 changed files with 95 additions and 7 deletions

View File

@@ -175,12 +175,32 @@ function Test-PreCommit {
### 常见问题
1. **PowerShell执行策略错误**
1. **"nothing to commit, working tree clean" 错误**
```
原因: 工作区没有未提交的更改
解决: 脚本已自动检测并跳过推送,这是正常行为
```
2. **推送失败 (Push failed)**
```
可能原因:
- 网络连接问题
- 远程仓库权限不足
- 分支冲突
- 需要先拉取远程更改
解决方案:
1. 检查网络连接
2. 运行: git pull origin main
3. 重新运行推送脚本
```
3. **PowerShell执行策略错误**
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
2. **Git认证失败**
4. **Git认证失败**
```bash
# 检查远程仓库配置
git remote -v
@@ -189,12 +209,18 @@ function Test-PreCommit {
git config --global credential.helper store
```
3. **编码问题**
5. **编码问题**
```bash
# 确保控制台支持UTF-8
chcp 65001
```
6. **重复使用脚本报错**
```
原因: 工作区已干净,无需再次推送
解决: 脚本已优化,会自动检测并跳过
```
### 错误代码说明
- `退出代码 0`: 成功