I have heard that it is possible to have a local Git repository on a developer machine, while keeping a master copy of the source code stored in a svn repository.
A good use case would be that you have a central svn repository that each developer works with. One developer goes offline occasionally and would like to track changes he/she makes while offline. When the developer is back online and has access to svn, their working copy modifications could be checked into svn. I’m fine with losing the history of changes that happened locally with Git, when the files are checked into svn.
Can someone outline how best to pull this off? Are there any pitfalls to working like this?
You could use something like this tutorial as a starting point. I also read this tutorial.
There are several pitfalls to this mode of working. The most important one is that you cannot be using svn version 1.5 mergeinfo and expect this to survive through git. This is a major drawback if you’re using the (arguably fairly decent) svn 1.5 merge functionality.
The man page for git-svn also contains some notes under the “caveats” that section that you should understand. Once I understood all the caveats I understood the benefits of using this setup to be less than the actual cost for my specific case. So I used my energy to convince the project to switch to git instead, something I just succeded in.