I've been using Git for my personal projects for about six months now, but I've only recently taken the plunge into using it for work projects as well.
There are many good articles and talks out there on what Git is and what makes it different from "normal" version control systems like CVS and Subversion (SVN). In the interests of brevity, I will only summarize: with Git, your entire repository is cloned onto every developer's computer, and this opens up a huge range of possibilities for repository management. In addition, Git's revisions are cryptographically dependent on all previous revisions, so it is impossible to intentionally or unintentionally corrupt a repository.
We use Subversion here as our main source repository, and Subversion has worked very well for us in most ways. However, we like to use branches a lot, to segregate our work until it's ready to be merged, and this is one area where SVN just doesn't cut the mustard. To work around SVN's limitations, we tag our merge commits with the left hand and right hand revisions in the commit messages. This is passable, but error-prone and brittle.
In addition, when I'm coding, I tend to be a Machine Gun Committer. I commit constantly so I can always get a fine grained picture of how I've been working and what I've been doing. With a little bit of legwork, this also allows me to more accurately pin-point where my bugs showed up. However, it annoys my coworkers to no end, and I can see their point. It is pretty obnoxious.
Git offers the solutions to all these problems and more, all while integrating cleanly with our existing Subversion repository.
Let's start by first cloning your existing SVN repository into Git with git-svn:
% git-svn clone http://localhost/mysvnproj -T trunk -b branches -t tags
...
Now you have a private copy of mysvnproj (and it's entire history) in Git. A quick note: your "trunk" branch in SVN is called "master" in Git. You can change this behavior, but by default this is what you'll get.
Any changes you make in mysvnproj can be pushed back to the SVN repository when you're finished with "git-svn dcommit":
% git-svn dcommit
...
Pulling updates from the SVN repository into your Git repository is done with "git-svn rebase":
% git-svn rebase
...
This will not commit any of your local changes, but "rebase" them onto the new SVN head. In git terminology, "rebasing" takes a set of changes and applies them to a new head. I find it's useful to imagine this as a graph:
/------ B
/
A ------/-------- master
If I rebase B to master, the new change graph looks like this:
/------ B
/
A -------------- master
This changes my local commit history to look like B inherited from the current master, rather than at some point in its history.
Now, the only other thing we have to cover in this installment is using an SVN-hosted branch. This is subtly different from a normal git branch, because it backends into SVN and thus can't use much of Git's history analysis for branching and merging. Because merging isn't made any easier (and in some ways is made harder) by using SVN branches, I prefer not to use them. Never-the-less, sometimes you might need to.
The good news is that once a branch has been created in SVN, you can use that branch in Git fairly easily:
% git-checkout mysvnbranch
% git-checkout -b local/mysvnbranch
This will tie your SVN branch to local/mysvnbranch so "git-svn dcommit" will Do The Right Thing™.
Over the next few days we'll dive into some work flows that will help show the power of Git, as well as solve the problems I've outlined above. Stay tuned!