pet icon indicating copy to clipboard operation
pet copied to clipboard

Sync Improvement - merge snippets instead of overwrite

Open brpaz opened this issue 8 years ago • 12 comments

Hi. First of all, congratulations for building this tool I am using it everyday.

I added lots of snippets in the last days, and today I decided to run pet sync in order to synchronize to my snippets gist. But I didn´t specify the -u flag, so it downloaded the contents of the gist file and replaced all my newly created snippets! fortunately I had a backup. I was not aware of this behavior. I think sync should merge the contents of local and remote files and not replacing them like this. The current behavior is more of a backup, than a sync really. It I have pet running of two machines and add snippets In both of then, there is no way to sync automatically without losing data.

Hope this can be improved.

Keep up the good work!

brpaz avatar Oct 05 '17 21:10 brpaz

+1

kpron avatar Jan 30 '18 13:01 kpron

@brpaz I'm sorry for the too late reply! I released v0.3.0. https://github.com/knqyf263/pet/releases/tag/v0.3.0

I changed the behavior of pet sync. pet sync compares the local file and gist with the update date and download or upload automatically. So -u option is deprecated. Please see https://github.com/knqyf263/pet#sync

In addition, auto_sync is added. https://github.com/knqyf263/pet#auto-sync

knqyf263 avatar Feb 10 '18 10:02 knqyf263