Virtual Branches Disappear when Removing/Re-Adding Project
I opened another ticket regarding Virtual Branches failing to push. In an effort to try fixing this, I removed the project from GitButler, and re-added it. In doing so, my virtual branches disappeared. These virtual branches don't exist as real branches so now basically all branches I had in GitButler are effectively gone. Now these do exist in refs/gitbutler and visible through git show-ref, but the branch names are lost, and this probably isn't obvious to most git users.
It would seem GitButler keeps state somewhere outside of the Git repo, which means if anything happens to this all of your branches disappear.
Thanks @zacheryph for highlighting this. I am glad you found this escape hatch yourself, but I agree that this should be better documented. The app keeps state in two paces - it's own namespaced refs in the repository and additionally the data folder which mostly contains metadata as well as CRDTs of changes.
I've made a task to update the docs (and link to it from the app) with this escape hatch because it's very useful to know about. Probably a good place to list provide this info is in the removal confirmation window.
Separately to the documentation, i am wondering if it's a good idea to retain the workspace state of vbranches after re-adding the project.
It seems that as of Version 0.11.3 (20240419.070253), this isn't the case anymore and removing/re-adding a project keeps virtual branches (please see the video below).
https://github.com/gitbutlerapp/gitbutler/assets/63622/f416dfb9-b928-4481-aad7-51aff8c7ddc0
Maybe there is something I am missing though, could you help @zacheryph ? Thank you.