Newbie's guide to Anvil and Git/Github

My work flow is as follows

  • add ssh keys to anvil and github as per this tutorial:
    (I don’t think it’s necessary but saves the hassle of passwords)

https://youtu.be/hQWRp-FdTpc

  • 3 remotes:
    • github, anvil_prod, anvil_dev (origin)
  • local machine

  1. clone from anvil_dev to local machine (anvil_dev is now origin)
  2. add remotes github and anvil_prod using the command: git remote add <name> <url>
  3. make edits in anvil ide in anvil_dev
  4. pull edits to local machine from origin (anvil_dev)
  5. push to github and anvil_prod
  6. if I have problems with pushing to anvil_prod it’s usually because i’ve inadvertently opened it and have a ‘saved automatically’ commit so I’ll force push the changes to anvil_prod
    (or i’ll go to the ide, version history, roll it back to the commit before ‘saved automatically’ and then push again)

For README.md and licences, I make these on my local machine and push these changes to all the repositories. They are viewable in github but not in the Anvil IDE.


i typically use vscode with the add ons: Git Graph and GitLens
Git Graph makes it easy to see the commit histories and
GitLens has some extra features compared to VS code’s builtin git tool (such as seeing your remotes easily)


2 Likes