PSA: Benefits of keeping local git repo in Dropbox folder
#1
The local Git repo for my addon is located in my Dropbox folder. That folder is sym-linked in the kodi/addons folder.

This allows for the same code to be backed up and synchronised across different installs. There may be better ways to do this, but this always seemed the easiest and fastest for me.

Anyway, I was working on something substantial for a few hours (restructuring my addon into multiple smaller files) when Kodi very helpfully downloaded and installed the last update that I had submitted to the official repo last week. (I normally have auto-updates switched off, but had it turned on to test an update from the repo, then I forgot about it.)

So when I tried to save the code I was working on in SublimeText, it said that the folder did not exist! The update had over-written all my changes, so there was no "undelete" or trash bin option to retrieve them. My git files were gone as well.

Fear not! Dropbox had been syncing all my changes! So I go to the website to revert to a previous version of the files. Oh, but the website only had the existing files, not all the new ones I had created. I couldn't see anywhere to retrieve them.

Here was the solution: I created new (empty) files with the same name as the ones that were overwritten/deleted. Once Dropbox synced, I was able to revert to the "previous versions" of those new files. SublimeText still had my latest code changes, so in the end I did not lose a single line of code. That's pretty flucky.

As I said, there may be better ways to back-up and synchronise, I don't know. But I strongly recommend doing something.
Reply
#2
PSA: when working on a new version, always update the addon version number first locally.
That way this can never happen in the first place Smile
Reply
#3
That as well!
Reply

Logout Mark Read Team Forum Stats Members Help
PSA: Benefits of keeping local git repo in Dropbox folder0