I created an empty branch in Git, and then connected to it with the Git remote feature.
This was fine and synchronized the branches from my Anvil App to the Git repository.
However, it also brought the empty branch from Git, into my web IDE.
It wasn’t the active branch, so it wasn’t a problem until I decided to check it out (check out branch).
I realise this was a mistake because the branch didn’t even have the .anvil_editor.yaml file which I presume is required for the IDE to work.
The result is when I try and open my app in the Web IDE, it shows this:
I had no issue cloning one of my branches into a different Anvil app, although I need to continue using the old one as it has a database, secrets set up, and is also deployed to a custom domain. For this reason, I don’t want to delete the existing application and would prefer if the working branch in the IDE can just be changed somehow.
This is proving a challenge as I cannot access the app in the IDE 
Here is a copy of the Chrome devtools log for troubleshooting.
NOTE: It could be one specific commit rather than an entire branch. It just seems likely it is due to the checked commit/branch not having anything in it! 
I have tried clearing the indexedDB without any change in success.
dev tools → application → indexed-db → anvil → state → clear button

Also, I can confirm this section of the logs is where the IDE falls over.
Seems to have something to do with the commit history or app remotes which is what I expect.
Hi @grantaustinpeace,
Yes, the IDE is very much not happy if it tries to open a branch that isn’t a valid Anvil app! Although this is a situation you can only get into by messing with the git repo by hand, we should probably handle it a little more gracefully now that such messing is easier…
Your best way out here is to make your new branch temporarily point at a commit with a valid anvil app. I suggest hard-reseting it to the same commit as master
, then force-pushing it, then loading the IDE and switching to another branch, then resetting and force-pushing your new branch back to where you want it.
4 Likes
Excellent!
This has solved the problem.
Changing branches is all that was required.
I also got some help from support.
Thanks for the help!
@meredydd
I have done it again. (facepalm)
How would you suggest hard-resetting it?
It appears support did this for me yesterday, although I will do it myself if there is an option. Obviously, the entire IDE is not available so I would have to force the current commit through the Git remote somehow.
Kind Regards,
Grant