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.
答案 0 :(得分:4)
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'