Gitify workflow with branches

I`m new to devOps but try to start versioning modx sites with git. At current moment my misunderstanding about merging between stage and production. Should I add to gitignore all files except files generated with Gitify to prevent incorrect merging? It is not clear for me how merging beetween branches solves in modx.Today site - for example I see config.core.php in root path in github whitch include absolute path to /core folder with config file. Path is different in prod, stage, dev branches. Could you describe best merging strategy for modx with Gitify?

Files that are specific to an environment, such as config.core.php, should be ignored from the repo. Those are instead set up once per environment.

Everything else, including your gitify data files and related assets, should be in the repo.

Then you can switch, merge and rebase changes across branches as git lets you do so nicely.