Pythonista sync between 1.5, 1.6, GitHub
Would it be possible to write a script compatible with both 1.5 and 1.6 that syncs files across multiple devices through GitHub?
I could have a repo called Pythonista in my github. Any changes I made would be saved to Github, maybe by running a script manually. Then, when I opened pythonista on either device, the files would be replaced with those from GitHub. Therefore, all files would be synced across devices.
It might be tricky if you actually use git elsewhere -- not sure what would happen if you have a repo that contains other repos. For instance all of the hidden .git files would need to get synced. That should work, but will br annoying to fix if you ever have to merge manually.
Otherwise... it should be possible to have the Documents folder be a top level repo, this should be doable now in stash.. To add all files, you would have to do a
git add * git add */* .... git add */*/*/*/*/*/*.....
(or else we could add a new switch to git add that does a full tree walk). You will need to be diligent about always doing a
git pullbefore starting work on a device, and a commit and push when finished, otherwise you will easily get out of sync and have to use merge... while get merge does work in stash, It can be tricky, and ai am not sure how many people have actually used it other than me. It is also embarrassingly easy to cause work to be lost in the current stash git implementation.
Is it possible to put this in
yes, but i wouldn't advise it... i think it would be very time consuming, for instance it pythonista crashes you might be waiting several minutes for it to get going again.
Maybe you could keep a log of how long it has been since the last time it ran.
To avoid dangerous overwriting of in process work, i would recommend doing a
git fetch, but then only manually use
git mergeto merge origin into your current work, after first committing the current working copy. This should then let you
This will be extremely slow, as currently we have thin packs turned off (dulwich issue), so as a result, every time you sync the entire history will be transferred. I have a kludge that enables thin packs, but was waiting until dulwich incorporated a fix.
If I decide I don't care about GitHub is there an easier solution using dropbox/iCloud drive?
FTP sync should work well, I think my deentaylor.com domain server supports FTP accounts. I can create a folder on my server called Pythonista, and then create a special FTP account to modify it.
I wrote an FTP sync script specifically for this type of situation, feel free to use it.
Yeah. I'm not sure I've gotten it working, but I'll see.
@Webmaster4o If you are having problems, please tell me. I need all the bug reports I can get.