We use the two app approach for development and production, but we don’t use any fancy git commands.
On your step 2 you mention the loss of history as a problem, we consider it a feature!
Initial setup
- Clone the app in Anvil
- Call the app with the full history App Dev and the new one App Prod
- Git clone both the apps to your computer. At this point you have two apps with the same files but with different history
- On one of the two apps delete the tables that need to be identical in development and in production and add them again as shared tables
Everyday workflow
- Work on App Dev either on the browser or on the desktop, creating dozens of commits, most of them just noise automatically committed by the online IDE
- When App Dev works pull it to my local repository
- Copy the files from App Dev to App Prod (manually or with a batch script)
- Commit and push App Prod
We never use git commands directly, we only use PyCharm pull and push buttons (and create change lists and commit them inside PyCharm too).
At this point the history of App Prod is clean and only shows the intended commits.
Access to tables via Anvil ‘app_tables’ will work seamlessly as long as the apps either share the same tables or use different tables with the same name. Access via SQL requires a line at the beginning of the module to set the correct table name.