Change your app.json to base-app.json and untrack the original file in your .gitignore
Then add something like
"generateConfig": "rimraf app.json && node generateConfig"
to your package.json
scripts, and yarn generateConfig && react-native-scripts start
to scripts like "start" or any others that may need app.json generated.