GitHub回购分支中的不同配置文件 [英] Different Config Files in GitHub Repo Branch
问题描述
我怎样才能以最简单的方式实现这一点?一个永久性的解决方案会很好,但是从目前我读到的内容来看,它会涉及到藏匿和流行?或者可能只是在2个配置文件被覆盖后执行撤消/还原?
这对我来说并不理想,因为它会导致Travis-CI开始2个独立的编译/部署过程。
Nick。
您可以使用我们的
策略来做到这一点。在两个分支中创建一个名为 .gitattributes
的文件,并在其中添加以下内容:
path / to / your / config.json merge = our
然后提交你的 .gitattributes
文件:
git add。
git commit -m'新增gitattributes'
So I have a GitHub repo with a master branch and a staging branch, they both have separate config files for deploying to different places. I was hoping that when I perform a pull request on the staging branch back to master, that I could some how exclude the 2 config files that I want to remain different in both branches.
How can I achieve this in the easiest way? A permanent solution would be great, but from what I've read so far it would involve doing a "stash" and a "pop"? Or maybe just performing an "undo" / "revert" after the 2 config files are overwritten?
This isn't ideal for me as it will cause Travis-CI to kick off 2 separate compilation / deployment processes.
Nick.
You can do this using the ours
strategy. Create a file named .gitattributes
in your both branches and add the following content in it:
path/to/your/config.json merge=ours
Then commit your the .gitattributes
files:
git add .
git commit -m 'Added gitattributes'
这篇关于GitHub回购分支中的不同配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!