当前位置: 动力学知识库 > 问答 > 编程问答 >

git - Specify merge strategy for specific folder at remote repository

问题描述:

We are planning to store our configuration files in GIT. I am thinking of a separate folder in GIT where I can hold "environment specific" configs, like service endpoints, etc. For this particular folder, I'm thinking of setting .gitattributes to customize the merge strategy as described in this link - https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes. Thus the environment specific folder will be always specialized and will not be merged, while the other normal configurations can get merged and rebased. Something like this:

'/envtOverrides

'/serviceEndpoints.json

/dbURLs.json

/featureFlags.json

/otherconfigFile.json

The only problem is, while I can do this for my own configurations, I also want to be able to mandate this on anybody belonging my ORG (or atleast, anyone who is a member of my team). The procedure in the above link requires me to set the following configuration on my local repository:

git config --global merge.ours.driver true

Is there any way for me to specify the merge strategy for specific folder at the remote repository?

Thanks in advance!

分享给朋友:
您可能感兴趣的文章:
随机阅读: