0

I have a repo with 2 branches; master and dev. There's this config.json file which is different for production and dev environments so I'd like to keep these files out of merge when I merge from dev to master.

Is there a way to do this permanently so whatever changes I make in dev branch and merge into master, it will never include the changes that is made into config.json file so I can keep their own versions of this file in both branches?

I could've used .gitignore but that would not include the file in their own branches when I do a git commit and git push.

isherwood
  • 58,414
  • 16
  • 114
  • 157
Marry Jane
  • 305
  • 2
  • 15
  • 7
    In a word: don't. Find a different way to accomplish your goal, such as storing both, and choosing one based on environment. – Jonathan Hall Jul 10 '19 at 16:24
  • Possible duplicate of [How to ignore files in Git merge?](https://stackoverflow.com/questions/19069179/how-to-ignore-files-in-git-merge) – isherwood Jul 10 '19 at 16:26

0 Answers0