git工作流程

以财务开发为例子:

1. 新建分支

1.1. upstream新建分支:finance-feature

1.2. origin新建对应分支:finance-feature

1.3 新建本地分支

复制代码
git branch finance-feature

注:

同步远程分支:git fetch upstream feature-name git fetch origin feature-name e.g.git fetch upstream finance-feature

查看本地分支:git branch

查看远程分支:git branch -r

切换分支:git checkout branch-name e.g.git checkout finance-feature

2. 开发finance-feature功能

2.1 拉取代码

复制代码
git checkout finance-feature
git pull upstream finance-feature
git pull origin finance-feature

2.2 coding......

2.3 推送代码

复制代码
git push origin finance-feature

2.4 提MR请求合并代码

3. 开发紧急功能或者修复admin bug,过程同上,将分支名 finance-feature改成master即可。

相关推荐
旅之灵夫10 小时前
【GitHub项目推荐--Harness:一体化的开源 DevOps 平台】⭐
github
恋喵大鲤鱼12 小时前
git reflog
git·git reflog
虾壳云智能12 小时前
详解 OpenClaw 部署难点 绕过安全拦截与路径报错解决方案
人工智能·github·open claw教程·open claw一键部署
_codemonster13 小时前
Codex中github cli未通过身份验证解决方法
github
MatrixOrigin13 小时前
MatrixOne Git4Data 技术详解(二):从零跑通所有 Git 原语
git
anew___13 小时前
常用的 Git 工作流
git
shimly12345614 小时前
git diff 生成一部分文件的补丁
git
baozj14 小时前
把徒步轨迹做成 3D 地形模型:开源工具「印迹 TrailPrint 3D」
前端·vue.js·github
m0_5791466514 小时前
Git 重置模式详解:四种重置方式的原理与应用场景
git
恋喵大鲤鱼14 小时前
git grep
git·git grep