Live Chat

We'll need to share your messages (and your email address if you're logged in) with our live chat provider, Drift. Here's their privacy policy.

If you don't want to do this, you can email us instead at contact@anvil.works.

Git

Each Anvil app is represented by a Git repository. If you click the Clone with Git button in the Version History dialog, you will be able to clone your Anvil app onto your own machine.

The Clone With Git dialog, with a box to copy your SSH public key into.

When cloned, the Git repository will be placed in a directory named using the app ID - that’s the string you see in the URL when you’re editing the app in the Anvil Editor, and the string you get from anvil.app.id in code. You can safely rename the directory to whatever you like.

Structure of the Git repository

The files in the repository are everything Anvil uses to represent an app - there are no hidden configuration files that don’t get cloned.

The Git repository for your app contains:

  • anvil.yaml: The configuration relating to your app as a whole.
  • forms: The code and config for each of your Forms.
    • <form name>.py: The Python code for each Form is in a separate file. This is exactly the code you see in the Code View of the Editor.
    • <form name>.yaml: This file defines the Form’s template, its properties, its components and their properties.
  • server_modules: The Python code for each of your Server Modules. This is exactly the code you see in the Code View of the Editor.
  • theme: Configuration files relating to the functionality found in the Theme section of the App Browser.
    • assets: The files contained in the Assets part of the Theme section.

You can edit the files in the repo and make commits. You can then push these commits back to Anvil and you will see them in the Editor. If you have made changes in the Anvil Editor as well, you can pull these and merge or rebase, as you normally would when collaborating on a project using Git. That way, you can use the drag-and-drop Anvil Editor and modify the code in a local IDE - there should rarely be merge conflicts if you do this.

The master branch represents the version of the app in the Anvil Editor. If a published version is selected, this is represented by the published branch.

Authenticating

To authenticate your local Git with Anvil, you can either use your Anvil username and password, or copy an SSH public key into the Clone With Git dialog. This must be the SSH key you’re using with Git.

If you’re using two factor authentication you must use SSH rather than username and password.