用于构建Git分支的实用工具我将多个其他分支合并在一起。
git-build-branch的Python项目详细描述
通过合并多个其他分支来构建Git分支的实用工具。在
- 自由软件:BSD许可证
文件
在某些情况下,可能需要完全控制所部署的代码。这个罐子 通过创建一个YAML配置文件来描述应该包含在分支中的内容。在
文件格式如下:
trunk:mastername:autostaging# name of the branch to buildbranches:# list of branches to merge into final branch-feature1-feature2-forkowner:feature3# branch from fork of repositorysubmodules:submodules/module1:branches:-feature1-forkowner:feature2# branch from fork of repositorysubmodules/module2:trunk:developbranches:-feature2
要在该文件周围添加一些安全性,您应该使用safe-commit-files实用程序:
^{pr2}$建立分支机构
此配置文件可用于生成部署分支:
git checkout master git-build-branch path/to/branch_config.yml
冲突解决
首先,确定冲突所在。在
a)段。分支foo与master冲突
git checkout -b foo origin/foo
git pull origin master
# try to resolve conflict
git push origin foo
b)段。分支foo与分支bar冲突
你不能把foo合并成bar,反之亦然 for foo将包含来自bar的提交。换成第三个, 冲突解决部门:
git checkout -b foo+bar --no-track origin/foo
git pull origin bar
# try to resolve conflict
git push origin foo+bar
现在将分支foo+bar添加到branch_config.yml,并将分支foo和 酒吧就在它的正下方。在
稍后,分支B合并到主分支中,并从branch_config.yml中删除。在
也许删除它的人也会注意到A+B并执行 跟随。否则任何一个看到A+B但不能同时看到两者的人 分支机构可以随意假设需要完成以下工作。在
- 将A+B合并到A中。由于B现在不在了,您想合并 解析成A,否则A将与master冲突。在
- 从branch_config.yml中删除A+B。已经没有必要了,因为 现在是a的子集
如果您不确定如何解决冲突,请通知分支所有者。在
- 项目
标签: