每个git分支都有不同的配置 [英] Different configs in each git branch

查看:434
本文介绍了每个git分支都有不同的配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个git分支: dev master



我使用Travis CI进行构建和测试,并且需要具有不同的 .travis.yml config.yml.enc (加密配置文件)。

如何合并来自 dev-> master 没有合并 .travis.yml config.yml.enc 文件?

解决方案

您在这里有多个选项(在master分支上):

  git merge --no-commit dev 

git checkout .travis.yml

git checkout config.yml.end

git commit -mmerge dev into master

这可以合并文件,然后将这两个文件恢复到最后一个主提交。



或者你可以运行(如果你的提交历史记录是以这种方式设置):

  git cherry-pick commit_hash 

添加不修改文件的提交。


I have two git branches: dev and master

I'm using Travis CI for builds and testing and need to have different .travis.yml and config.yml.enc (encrypted config file) for each branch/environment.

How do I merge changes from dev->master without merging the .travis.yml and config.yml.enc files?

解决方案

You have multiple options here (on master branch):

You can either run:

git merge --no-commit dev

git checkout .travis.yml

git checkout config.yml.end

git commit -m "merge dev into master"

This will merge the files then revert the two files to the last master commit.

Or you can run (if your commit history is setup this way):

git cherry-pick commit_hash

Adding commits where the files are not modified.

这篇关于每个git分支都有不同的配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆