I am looking at using a version control system to ensure that I can go back in time to a particular version for all documents in ~, if I have to.
What is the best suited tool for this given that:
- I am without much experience in version control systems
- Several files will be plain text files but there will be some Libre-Office files also
The tool should:
- Be easy to set-up, run and maintain
- Have easy to understand configuration options (what directories to track, for how long, how frequently the changes should be captured, etc.)
- Ideally have a GUI front also
- Be able to recover deleted files
What is the best/ most widely used tool that will be suitable for me?
I have used CVS, Subversion, git, and a few commercial packages. I just migrated my personal VCS from CVS to git (I thought it was going to be more difficult than what it actually was, I should have done it long ago).
I would recommend git. Based upon what you are looking for.
git may have a longer learning curve, especially if you have experience with a previous VCS. Without having been exposed to a previous VCS, your learning curve maybe be shorter.
The best way to learn git is download the book Pro Git by Scott Chacon (for free), create a test repository (
mkdir <project name>; cd <project name>; git init
), and hack away at it. There is really is no effort to create a repository and don't worry about screwing something up in a test repository, as each repository is independent. A repository can be easily removed (cd <project name>; rm -rf .git
).There is no differentiation with git on file types (ASCII vs binary), however ASCII files are optimal for seeing diffs and merging conflicts.
git can be configured in a number of ways, it all depends upon what your needs are. For starters, a one many show, all you have to do is install git (
sudo apt-get install --install-recommends git-core
) and create a repository (shown above). If you work across a number of machines, you can set up git over ssh (it is in the book). Even better, as your needs expand you don't loose what you have done already.You can have one big repository or break them down to individual projects or down to single files. Again create a git repository and play around with it, see what works and does not.
There are many git guis that specialize in many different tasks. However learning git from the command line is highly recommended. To get started you only need to learn a few commands (
git init
,git status
git diff
,git add
,git rm
,git commit
,git push
,git pull
). Also the command line helps you with tasks you need to do. For example:git status
If you are more comfortable with a GUI, SmartGit is newbie friendly.
Yes, git can recover any version of any file as long as it has been committed.
git is widely used. As far as the best goes, it is among the best, if not the best. But being the best, is more of a personal opinion and is also based upon the situation.
The way it sounds, I think using a version control like
git
, Mercurialhg
,bzr
orsvn
is not a perfect fit for your needs, since they are primarily targeted for source files, not binary data. Thus, I want to add some additional possibilities here.I think a nice solution would be a cloud based backup service. I personally use SpiderOak, which works really well.
Déjà Dup
Uses
duplicity
as its backend.Pros
Cons
If it's not there already, install it:
You can find it in dash if you enter
backup
.SpiderOak
Pros
sources.list
(auto updates)Cons
Download it here: SpiderOak Download
rdiff-backup
Pros
rsync
algorithm, only tracks changesCons
Install it via:
BTRFS snapshots
Although not for the faint of heart, there is the possibility to have your
/home
directory on a seperate BTRFS partition and create snapshots of that once in a whilePros
Cons
There is a howto on Ubuntus help pages.
I would recommend git because:
Well known versioncontrol-systems are CVS, SVN (subversion) and GIT. There is no need to think about ye olde CVS, so that leaves us SVN and GIT.
For your limited use I don't think that it really matters which you choose, so my advice would be to see who you know that uses one of them, and choose that :)
If you are looking for ease-of-use for the more complicated stuff (real version control for code etc) I would suggest using GIT. Basically "them" say that SVN was an update for CVS, and GIT again is an 'update' to SVN. I personally think that the advantages of GIT over SVN are specifically for multiple users and multiple branches, so maybe not really something you should worry about.
On the other hand, why not have some experience with the better option available, you never know what you want to do in the future.
Please check out some the info on them
I do not think you want to do this. Source control is just for that, source control. Most do not handle binary files (like images, music, movies, etc.) very well.
Also SCMs will give you a line by line chunk of what data has changed. So every time you log in or log out, you will be changing some data. You will have to "merge" or "commit" all the time. I am almost certain this is not what you want.
However, there are a couple of really good tools.
Back-In-Time is awesome, and has a diff viewer. Deja Dupe is the default, but I don't think it's very feature rich. grsync can give you a list of files against a backup that have changed. and plain old rsync is an option.
If you insist on using a SCM then I recommend git, but hosted locally. Add a .gitignore that excludes all binary files. Better yet, you could try just verson controlling your config directories. Again your going to have to watch out for binary files.
Reading through your question again, I think what you want is a local repository created with a tool such as
svn
, and maintained with its frontend,rapidsvn
. This would seem to suit your purpose particularly well: the local repository could be on your main hard disk or on an external drive. It is important to note that version control is best suited to source code or text files or documents and is not suitable for multimedia files.Dropbox
orUbuntu One
would be better for that kind of backup. In addition, you can go back to previous versions of files withdropbox
.Anyway, I will briefly show how the gui tool
rapidsvn
works and howsvn
is used from the command-line.Firstly, install the necessary files with
More information is available at the official site for
rapidsvn
, although it is important to note that you must still create your svn repository with the command-line first. Make sure you are at the top level of your home folder (entercd
to get to it if necessary) and enter:Then create an initial folder with
Using the quickstart guide we can load up
rapidsvn
, right click bookmarks and add your repository by clicking Checkout New Working Copy and from then on you can manipulate your files as you wish with checkouts, imports, and commits.I think this is probably just the gui you were looking for, as it can easily manage all your files, and it is easier to configure the options than using
svn
on the command-line.You can use Codebase .
GNU RCS (Revision Control System) manages multiple revisions of files. RCS can store, retrieve, log, identify, and merge revisions. It is useful for files that are revised frequently, e.g. programs, documentation, graphics, and papers. It can handle text as well as binary files, although functionality is reduced for the latter.
The basic user interface is extremely simple. The novice only needs to learn two commands: ci and co. ci, short for checkin deposits the contents of a file into an archival file called an RCS file. An RCS file contains all revisions of a particular file. co is short for checkout.
Need to diff your changes? rcsdiff.
Project Page: http://savannah.gnu.org/projects/rcs/
Manual: http://www.gnu.org/software/rcs/manual/rcs.html
I "need at least 10 reputation to post more than 2 links" so the following will need to be altered by the reader in order to get to the link. Writeup by the author that you may want to read eventually:
http://www.gnu.org/software/rcs/tichy-paper.pdf
A nice summary and geneology of various revision control system software available:
http://en.wikipedia.org/wiki/Revision_Control