-
Notifications
You must be signed in to change notification settings - Fork 17
Backup Code into the Cloud
The most important goal of SrcBox is to allow the creation, constant maintenance and all time availability of backups, without the need of any paid third party hosting services or personally maintained servers.
This tutorial assumes that we either have a yet unversioned project that we would like to add versioning to and backup in the cloud, or we would like to start a brand new project tracked by SrcBox. In either case, let’s call the project myapp.
The first thing to do is to create a new empty git repository inside SrcBox and initialize it. This will place a readme file into the new repo to make git happy (it doesn’t like empty repos).
$ srcbox create myapp git
Creating empty git repository...
Initializing new git repository...
Git repository successfully created.
Find a suitable working folder for the project and change to that specific directory. Here, clone the newly created repository. This will result in a subfolder being created with the name of the cloned repo (so in case you would like to clone to /work/uni/myapp, then issue the clone in /work/uni).
$ srcbox clone myapp
Cloning git repository...
Git repository successfully cloned.
From this point onward it’s a simple git workflow to back up things into the cloud:
$ echo “Some change” > somefile.txt
$ git add somefile.txt
$ git commit –m “Created some file”
$ git push
Whenever you issue a git-push, your committed changes will be pushed into SrcBox, and subsequently synchronized and backed up in the cloud. Be sure to wait until the Dropbox synchronization finishes before turning off the computer in order to have everything fully backed up.
Check the next tutorial for info on how to access a repository from multiple machines and update the data committed from a different location.