I tried backing up my project on gitHub and defold crashed and “reverted”.
All was fine. I just tried again, and it did a pull from Github and took my project back 5 months.
I lost sooo much source code, image files and edits. I feel like just giving up…
I am using 1.9.5, as I updated from 1.9.1. That is how far back it went. Not sure if this is a bug or not.
I’m terribly sorry. That’s a real gut punch. Did you make commits during those five months? If so, it’s most likely possible to recover the lost commits. Commits that do not belong to any branch in Git (meaning, you can’t see them) will still exist in the repository for some time. You can list these with git reflog, and from there recover them by creating a new branch that points to one of them. See this StackOverflow answer: https://stackoverflow.com/a/34751908/8034688
Part of getting the most out of github is frequently identifying when your code is at a good restore point and committing it. It takes a while to develop good commit habits. Part of what leads to it is having disasters that set you back. Pretty much everyone learns the hard way. Hopefully you have some commits saved that you don’t realize can be restored.
Ugh!
The files I lost after clicking ‘pull’ were omitted from Defold’s changed files list. All those files, new files, were deleted. Why would any software delete files from my folder without asking? DANG IT!
Terribly sorry to hear that. There might exist a git stash in your repository with the state of the working directory how it was before the sync with GitHub.
THIS! Don’t be afraid of creating feature branches with the stuff you are currently working on and commit often. Then squash the commits when you merge back to your main development branch to not clutter it with a bunch of dev commits.
This has happened to me twice. I only noticed when I was trying to bundle a project and realized that defold was referencing an older version of the script. I then closed defold just to see the file revert back.
I do have a question, had you closed the Defold app at all during this time? Or did you leave it running on your device? I have a hypothesis that leaving Defold running (therefore allowing it to use up more and more memory over time) causes this issue, but I have no proof for this.
This is a Defold issue by the way; GitHub can’t push be use Defold isn’t flushing the files so git can’t see changes
It happened to me once as well. That time I had uncommitted changes when I did an editor update.
Fortunately it was a minimal loss but I also could not reproduce it.
It goes without saying that I now commit before updating, and that’s in general good practice.
I commit every time I do something and my brains goes, “okay it works.”
Sometimes you even do it before the thing fully works, just before you’re about to start something that you don’t know if it will work.
At first it seems like you spend a lot of time logging everything you did but it eventually becomes second nature and saves you a lot of time when you need to be able to comb back through the history.
Also would be a good idea to periodically check that everything is actually being committed, as if the files aren’t on your computer git won’t get it. When I had his issue I assumed that Defold simply kept the fies in its memory for one reason or another. It’s weird cuz the 2 times it happened to me I was trying to bundle and it was stuck back at a specific time where there was an error in a script that no longer exists, but the compiler says there’s an error cuz it’s reading from the file that wasn’t updated
The reasoning is that it occasionally seems to trip up, and not work as the users expect.
At the same time, there are much better tools out there, and we’d rather defer to their workflows.
E.g. we wouldn’t add an image editing tool in our editor, there’s Krita and Photoshop for that.
Similarly, there are tools dedicated for source control.