I am current running a number of repositories for my companies application.
We have two repositories that require settings files for their builds to function. These settings files are different depending on local, dev, staging and production builds.
Each project has a development, staging and production branch.
I have add a .gitattributes file with the following contents:
gomo-campaign-api/src/main/webapp/WEB-INF/database.properties.xxx merge=ours
gomo-campaign-api/src/main/webapp/WEB-INF/gomo-messenger-config.xml.xxx merge=ours
gomo-campaign-api/src/main/webapp/WEB-INF/hibernate.cfg.xml.xxx merge=ours
gomo-campaign-api/src/main/webapp/WEB-INF/legacy-session-mapping.properties.xxx merge=ours
gomo-campaign-api/src/main/webapp/WEB-INF/log4j.properties.xxx merge=ours
gomo-campaign-api/src/main/webapp/WEB-INF/messengerPublisher.properties.xxx merge=ours
I also have an sh file I run with the following contents:
git update-index --assume-unchanged gomo-campaign-api/src/main/config/messengerPublisher.properties.xxx
ECHO ignoring log4j.properties.xxx
git update-index --assume-unchanged gomo-campaign-api/src/main/config/log4j.properties.xxx
ECHO ignoring legacy-session-mapping.properties.xxx
git update-index --assume-unchanged gomo-campaign-api/src/main/config/legacy-session-mapping.properties.xxx
ECHO ignoring hibernate.cfg.xml.xxx
git update-index --assume-unchanged gomo-campaign-api/src/main/config/hibernate.cfg.xml.xxx
ECHO ignoring gomo-messenger-config.xml.xxx
git update-index --assume-unchanged gomo-campaign-api/src/main/config/gomo-messenger-config.xml.xxx
ECHO ignoring database.properties.xxx
git update-index --assume-unchanged gomo-campaign-api/src/main/config/database.properties.xxx
ECHO Initialisation completed.
Neither of these strategies seem to work, if I do an auto merge, i.e
git checkout staging
git merge development
If anything has changed in any of those files, it is still trying to move the changes over.
Have I missed anything in the config for these strategies?
There is only me and one other user who will ever perform a dev > staging or staging > prod merge (or even has access to do so) Other users, must create pull requests to get their branches into development. So I can easily stop other users making the changes to the dev file and introducing local configs.
However, I really need to the merge to ignore these files on merges.
If I was to checkout staging and make a change and push it in to the repo, I want that change but do not want it to be moved to production.
I hope I have explained myself with enough detail.
Thanks in advance.