diff --git a/feature_branch_workflow.md b/feature_branch_workflow.md new file mode 100644 index 0000000..406a4ec --- /dev/null +++ b/feature_branch_workflow.md @@ -0,0 +1,101 @@ +# 功能分支开发与合并标准流程 + +本文档旨在说明一个标准、安全的功能开发流程,涵盖从创建分支到最终合并的完整步骤。 + +## 流程概述 + +1. **创建功能分支**:基于主开发分支(如 `lyf-dev`)在远程仓库创建一个新的功能分支(如 `lyf-dev-req0001`)。 +2. **同步到本地**:将远程的新分支同步到本地,并切换到该分支进行开发。 +3. **开发与提交**:在功能分支上进行代码开发,并频繁提交改动。 +4. **推送到远程**:定期将本地的提交推送到远程功能分支,用于备份和协作。 +5. **合并回主分支**:当功能开发和测试完成后,将功能分支合并回主开发分支。 + +--- + +## 详细操作步骤 + +### 第一步:同步并切换到功能分支 + +当远程仓库已经创建了新的功能分支后(例如 `lyf-dev-req0001`),本地需要执行以下命令来同步和切换。 + +1. **获取远程最新信息**: + ```bash + git fetch + ``` + 这个命令会拉取远程仓库的所有最新信息,包括新建的分支。 + +2. **创建并切换到本地分支**: + ```bash + git checkout lyf-dev-req0001 + ``` + Git 会自动检测到远程存在一个同名分支,并为您创建一个本地分支来跟踪它。 + +### 第二步:在功能分支上开发和提交 + +现在您可以在 `lyf-dev-req0001` 分支上安全地进行开发。 + +1. **进行代码修改**:添加、修改或删除文件以实现新功能。 + +2. **提交代码改动**: + ```bash + # 添加所有修改过的文件到暂存区 + git add . + + # 提交改动到本地仓库,并附上有意义的说明 + git commit -m "feat: 完成用户认证模块" + ``` + > **最佳实践**:保持提交的粒度小且描述清晰,方便代码审查和问题回溯。 + +### 第三步:推送功能分支到远程 + +为了备份代码和进行团队协作,需要将本地的提交推送到远程仓库。 + +```bash +# 将当前分支 (lyf-dev-req0001) 的提交推送到远程同名分支 +git push origin lyf-dev-req0001 +``` + +### 第四步:合并功能到主开发分支 (`lyf-dev`) + +当功能开发完毕并通过测试后,就可以准备将其合并回 `lyf-dev` 分支。 + +1. **切换到主开发分支**: + ```bash + git checkout lyf-dev + ``` + +2. **确保主开发分支是最新版本**: + 在合并前,务必先拉取远程 `lyf-dev` 的最新代码,以减少冲突的可能性。 + ```bash + git pull origin lyf-dev + ``` + +3. **合并功能分支**: + 将 `lyf-dev-req0001` 的所有改动合并到当前的 `lyf-dev` 分支。 + ```bash + git merge lyf-dev-req0001 + ``` + * **如果出现冲突 (Conflict)**:Git 会提示您哪些文件存在冲突。您需要手动打开这些文件,解决冲突部分,然后再次执行 `git add .` 和 `git commit` 来完成合并提交。 + * **如果没有冲突**:Git 会自动创建一个合并提交。 + +4. **将合并后的主分支推送到远程**: + ```bash + git push origin lyf-dev + ``` + +### 第五步:清理(可选) + +当功能分支确认不再需要后,可以删除它以保持仓库整洁。 + +1. **删除远程分支**: + ```bash + git push origin --delete lyf-dev-req0001 + ``` + +2. **删除本地分支**: + ```bash + git branch -d lyf-dev-req0001 + ``` + +--- +遵循以上流程可以确保您的开发工作流程清晰、安全且高效。 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 7587ab2..cd70cd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -56,3 +56,5 @@ tzdata==2025.2 werkzeug==3.1.3 win32-setctime==1.2.0 wsproto==1.2.0 + +python-dateutil diff --git a/server/models/__pycache__/__init__.cpython-313.pyc b/server/models/__pycache__/__init__.cpython-313.pyc index d7cfc3d..cab3c66 100644 Binary files a/server/models/__pycache__/__init__.cpython-313.pyc and b/server/models/__pycache__/__init__.cpython-313.pyc differ diff --git a/server/models/__pycache__/data_utils.cpython-313.pyc b/server/models/__pycache__/data_utils.cpython-313.pyc index 3ba7a46..01f2056 100644 Binary files a/server/models/__pycache__/data_utils.cpython-313.pyc and b/server/models/__pycache__/data_utils.cpython-313.pyc differ diff --git a/server/models/__pycache__/kan_model.cpython-313.pyc b/server/models/__pycache__/kan_model.cpython-313.pyc index 68d973e..effcb7e 100644 Binary files a/server/models/__pycache__/kan_model.cpython-313.pyc and b/server/models/__pycache__/kan_model.cpython-313.pyc differ diff --git a/server/models/__pycache__/mlstm_model.cpython-313.pyc b/server/models/__pycache__/mlstm_model.cpython-313.pyc index 088ea17..59692f5 100644 Binary files a/server/models/__pycache__/mlstm_model.cpython-313.pyc and b/server/models/__pycache__/mlstm_model.cpython-313.pyc differ diff --git a/server/models/__pycache__/model_manager.cpython-313.pyc b/server/models/__pycache__/model_manager.cpython-313.pyc index 61c8ad7..9016830 100644 Binary files a/server/models/__pycache__/model_manager.cpython-313.pyc and b/server/models/__pycache__/model_manager.cpython-313.pyc differ diff --git a/server/models/__pycache__/optimized_kan_forecaster.cpython-313.pyc b/server/models/__pycache__/optimized_kan_forecaster.cpython-313.pyc index 8d35784..e49e7a1 100644 Binary files a/server/models/__pycache__/optimized_kan_forecaster.cpython-313.pyc and b/server/models/__pycache__/optimized_kan_forecaster.cpython-313.pyc differ diff --git a/server/models/__pycache__/slstm_model.cpython-313.pyc b/server/models/__pycache__/slstm_model.cpython-313.pyc index 8360286..f3874ee 100644 Binary files a/server/models/__pycache__/slstm_model.cpython-313.pyc and b/server/models/__pycache__/slstm_model.cpython-313.pyc differ diff --git a/server/models/__pycache__/transformer_model.cpython-313.pyc b/server/models/__pycache__/transformer_model.cpython-313.pyc index 023db8f..b07c4f2 100644 Binary files a/server/models/__pycache__/transformer_model.cpython-313.pyc and b/server/models/__pycache__/transformer_model.cpython-313.pyc differ diff --git a/server/models/__pycache__/utils.cpython-313.pyc b/server/models/__pycache__/utils.cpython-313.pyc index 01d198f..c422343 100644 Binary files a/server/models/__pycache__/utils.cpython-313.pyc and b/server/models/__pycache__/utils.cpython-313.pyc differ