I have heard great recommendations on git & svn, so I decided to give a try out today, but I just can’t seem to understand how they work, and how to use them. I understand there a difference between git & svn but I am just getting the general overview, I tried both out and I am sticking with the one I get to work.
I installed git and svn on my ubuntu machine, where I do my web development. So I installed a git and svn main repository (remote uri) on my home folder and the working clone on my /var/www/ folder. Can I use it like this?
This is my understanding on how git and svn work, you make a main repository, then create a clone which copies the current files, then you can add/modify/delete files/folders and then submit (push) it back to the main repository, with comments of changes (commit)…
Is my understanding of them correct? It seems to me the only benefit of using them is that you have a backup, and can give comments (commit).
Definitely agree with Thomas on docs and especially tutorials. Work through them to get actual hands on experiance.
As for your question, you have a pretty good handle on it. The important difference is that SVN is “centralized”, which means that push and commit are effectively done in one step, as are pull and checkout. Git stores changesets, not revisions. Git also doesn’t have a “main” repository – you can make a repository and call it the main one, but really anyone can make their own repository and push only the changesets they want.
And per mano: Git and SVN may not be meant for backup, but if you’re using backup anyway, you might as well back up the repository and complete change history instead of just the current version. Then if you have a crash you still have the whole change history – but if you’re doing this with SVN you do have to back up the main repo and not the working directory.