To do that, i'm trying to use GIT.
I'm trying to develop a .sh script (under linux) to auto-commit all changes in a git repository and delete all history revision except last one. The repository must preserve only last commit data and clear all previous history (losing all data).
For example, i commit 3 files:
- file1: 12 MB;
- file2: 4 MB;
- file3: 12 KB;
After commit, my .git folder size is approximately 25 MB;
Now i delete file1 and file2.
After next commit my working copy is 12 KB and my .git folder is 25 MB.
I want to flush all data in repository (losing data) to obtain a smallest possible .git folder.
The problem is that I need to do that with ONE SINGLE NON-INTERACTIVE COMMAND LINE, because I need to do a cron script.
Browsing forums for hours I don't found solutions for this question.
The real question is: How to set up a bi-directional fast file sync? The folder to sync is big (20 GB with thousands of files). First sync will be very slow, no problem, but the second one should be faster, no more than 30-40 seconds comparing only changed files...
Thank you for any help.