简体   繁体   中英

How can I only upload deltas for version control to my server? Without forcing user to install any tools

I want to make a website that lets users upload files onto the cloud based web server. But I don't want the users to upload the complete file every time they make a change. I know github achieves this by making users install git in windows. Also, I don't want to force the users to install git on their systems.

How can I put a version control system as a drag and drop solution in my website?

Lets say on my website, a user has a file 'x'(130kb) already in his repo, and he makes changes to 'x'(now its 150kb) in his system and drags and drops it into my website, how can I ensure that only 20kb, (not exactly 20kb, I mean just the changes), is uploaded onto my server.

Maybe something like a light weight git alternative in javascript?

另请参阅此google lib以获取diff / patch: google-diff-match-patch

Based on the answer here I found jsdifflib which I would suggest could act as the basis of a browser based diff and send the diff/patch tool.

A couple of cautions:

  1. It is probably worth following the unified diff format so that standard patch tools can be used.
  2. Binary files, especially zip files, often get a lot bigger when diff is taken so you will either need to Forbid binary files, test for binary files and upload those directly, check if the patch is bigger than the whole file or a combination of the forgoing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM