use*_*018 5 git branching-and-merging
我们有以下分支机构:
master和develop.
我们创建了一个新的分支机构feature,develop并指派了一个团队来处理它.
在开发期间:
develop接受其他团队的新提交.feature接受由其工作的团队成员推送的新提交.有时develop需要更新热门修复程序feature.
当然,在周期结束时,feature应该合并到develop.
我们没有单一的工作流程来保持feature和它的本地副本同步develop,然后确保所有本地副本都基于相同的提交.
我建议的工作流程如下:
与时俱进 develop
develop我重新feature分支:
git checkout feature
git pull --rebase origin develop
git push origin feature
Run Code Online (Sandbox Code Playgroud)所有本地feature副本运行:git pull --rebase origin feature
feature从本地副本更新分支
feature分支机构的工作git pull --rebase origin feature他将他的提交合并到feature:
git checkout feature
git pull origin feature
git merge local-feature
git push origin feature
Run Code Online (Sandbox Code Playgroud)将feature分支合并到develop
我确保功能是最新的develop:
git checkout feature
git pull --rebase origin develop
Run Code Online (Sandbox Code Playgroud)我合并成develop:
git checkout develop
git pull origin develop
git merge feature
git push origin develop
Run Code Online (Sandbox Code Playgroud)我们完成所有pull --rebase这些工作以保持线性流量,并确保使用快进合并所有更改.
但是,正如您所知,每次都有很多命令可以运行.
这真的有必要吗?我们是以"正确"的方式做到这一点吗?
你会建议另一个流程吗?
我假设您遵循此模型:http ://nvie.com/posts/a-successful-git-branching-model/

我认为大多数演示的命令都是正确的,但是您可以通过实施git alliases使事情变得更容易
| 归档时间: |
|
| 查看次数: |
853 次 |
| 最近记录: |