I have a need for distributed file synchronization. So first of all, any suggestions? My idea is git since speed is an issue.
My git knowledge is pretty rudimentary though so here's what I did.
I downloaded the portable git (I'm on PC so msysgit). I placed a copy into c:\root\git and a copy into c:\root\git c:\client\git\
I created a directory c:\temp\root\content and created some files in it
c:\root\content>..\git\bin\git.exe init
c:\root\content>..\git\bin\git.exe add *
c:\root\content>..\git\bin\git.exe commit -f
c:\client>..\git\bin\git.exe clone file:///c:\root\content
This creates a content directory but it is empty! The files committed to root are not there.
Also when I do a pull command I get
C:\temp\client\content\content>c:\temp\client\git\bin\git.exe pull
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Your configuration specifies to merge the ref 'master' from the remote, but no such ref was fetched
Clearly I'm missing a concept. What's going on?
git-sync is used for syncing a personal fork with the upstream repository the personal fork was created from. Syncing here means updating all the branches in the personal fork that are also present in the upstream repository.
git-sync is a simple command that pulls a git repository into a local directory. It is a perfect "sidecar" container in Kubernetes - it can periodically pull files down from a repository so that an application can consume them. git-sync can pull one time, or on a regular interval.
Step 1: Click Microsoft OneDrive in the taskbar. Click the Help & settings icon and then choose the Settings field. Step 2: Click the Account tab and then select the Choose folders button. Step 3: Click the files and folders you want synced to OneDrive.
Check into http://sparkleshare.org/
Sparkleshare gives you a user experience similar to Dropbox, except that it's underlying sync engine is git. It's not the most stable thing, but you can watch it's log output to see what git commands it's going to achieve seamless syncing. Once you learn those, you can simply make your own sync scripts that are stable. I think most of sparkleshare's problems are in the GUI.
git-annex could be another tool to consider.
Git can be a good tool for synchronizing source between development and production, for one reason: It makes it easy to "hot fix" in production and check the fix back into the tree. Of course you should always reproduce the bug in a development or test environment and fix it there, but sometimes you can't.
Instead of git add *
, use git add .
Use git status
before committing to make sure that the appropriate files are staged for commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With