Files
Radar/Git更新说明.md
2026-03-03 17:55:12 +08:00

130 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Git更新说明文档
## 一、仓库信息
**远程仓库地址**: `http://lmhrt.cn:6771/zou/Radar.git`
**默认分支**: `main`
## 二、更新前准备
### 1. 检查当前状态
```bash
git status
```
### 2. 查看远程仓库配置
```bash
git remote -v
```
确保远程仓库地址正确,应该显示:
```
origin http://lmhrt.cn:6771/zou/Radar.git (fetch)
origin http://lmhrt.cn:6771/zou/Radar.git (push)
```
## 三、更新流程
### 1. 拉取最新代码(可选)
如果需要获取远程仓库的最新更改:
```bash
git pull origin main
```
### 2. 添加更改
将修改的文件添加到暂存区:
```bash
git add .
```
### 3. 提交更改
```bash
git commit -m "提交说明"
```
**提交说明建议格式**
- 功能添加:`feat: 添加XXX功能`
- 修复问题:`fix: 修复XXX问题`
- 代码优化:`refactor: 优化XXX代码`
- 文档更新:`docs: 更新XXX文档`
### 4. 推送代码
```bash
git push origin main
```
## 四、分支管理(可选)
### 创建新分支
```bash
git checkout -b 分支名称
```
### 切换分支
```bash
git checkout 分支名称
```
### 合并分支
```bash
git checkout main
git merge 分支名称
```
## 五、常见问题及解决方案
### 1. 推送失败 - 权限问题
**错误信息**`could not lock config file C:/Users/xxx/.gitconfig: Permission denied`
**解决方案**:使用 `--no-verify` 参数
```bash
git push -u origin main --no-verify
```
### 2. 推送失败 - 冲突问题
**错误信息**`failed to push some refs`
**解决方案**:先拉取远程代码,解决冲突后再推送
```bash
git pull origin main --rebase
git push origin main
```
### 3. 远程仓库地址变更
**解决方案**
```bash
git remote remove origin
git remote add origin http://lmhrt.cn:6771/zou/Radar.git
git push -u origin main
```
## 六、项目结构说明
```
├── src/
│ ├── main.cpp # 主程序
│ ├── radar_manager.cpp # 雷达数据处理
│ ├── radar_manager.h # 雷达管理器头文件
│ ├── wifi_manager.cpp # WiFi管理
│ └── wifi_manager.h # WiFi管理器头文件
├── platformio.ini # PlatformIO配置
├── data_formats_explanation.md # 数据格式说明
└── 传感器数据.txt # 传感器数据示例
```
## 七、更新注意事项
1. **代码规范**:保持代码风格一致,添加必要的注释
2. **测试验证**:更新后确保编译通过,功能正常
3. **提交信息**:使用清晰的提交信息,便于后续维护
4. **备份重要文件**:对关键配置文件进行备份
5. **版本控制**:定期提交,避免一次性提交过多更改
## 八、联系信息
如果遇到Git相关问题请联系项目维护人员。
---
**最后更新时间**2026-03-03
**文档版本**v1.0