title: git svn gatekeeper repository
body: <p>I have beem using git for quite some time now, mainly git-svn. Now I want to convince my colleagues to switch from svn to git. But unfortunaly the precondition is that the svn repository keeps on living quite some time. So I searched for an solution and came up with the book:</p>
  
  <p>Jon Loeliger's "Version Control with Git". I bought it and it is really good but I don't fully understand the guide to set up a git svn gatekeeper repo.</p>
  
  <blockquote>
    <p>In Chapter 16, he describes a
    situation in which there is a
    Subversion repository, and at least a
    couple users that want to be using
    Git.  He proposes a single
    "gatekeeper" git repository which is
    the only interface to subversion. 
    After git svn cloneing the subversion
    repo (with --prefix=svn/), all the
    branches are then pushed to a bare
    repository (git push ../svn-bare.git
    'refs/remotes/svn/<em>:refs/heads/svn/</em>',
    and other git users are told to clone
    this repo, which now contains local
    branches of all the svn remotes.</p>
  </blockquote>
  
  <p>This part works and I think I fully understand it. But I don't get the next part:</p>
  
  <p>If a developer that clones the bare repository pushes changes back from his repo to the bare repository and then I dcommit this in the bare repo to svn, the commits the user pushed are lost for good reason because of the replaced commits git-svn creates. Or am I wrong? How does this work? </p>
  
  <p>The book says</p>
  
  <blockquote>
    <p>Then, to merge back to subversion, in
    the gatekeeper repo, you do</p>
    
    <p>git checkout svn/trunk (or other
    branch - this is checking out a
    detached head as svn/trunk is a
    remote) 
    git merge --no-ff new-feature
    git svn dcommit</p>
  </blockquote>
  
  <p>How can I checkout a branch in a bare repository? I don't think this works</p>
  
  <blockquote>
    <p>This results in a merge commit on a
    detached head, and then the modified
    commit (after the git-svn-id line is
    added) is put on the real svn/trunk
    branch.  </p>
  </blockquote>
  
  <p>What is meant by real svn/trunk ?</p>
  
  <blockquote>
    <p>The commit on the detached
    head is "worse than redundant.  Using
    it for anything else eventually
    results in conflicts.  So, just forget
    about that commit.  If you haven't put
    it on a branch in the first place,
    it's that much easier to forget" (Jon
    Loeliger).</p>
  </blockquote>
  
  <p>I'm a little confused. Has someone a better explanation for creating a git svn gatekeeper repo? I have searched the web and this site but I haven't found anything that seems suitable for me.</p>
  
  <p>I'm so tired of wasting so many time with svn branching and merging, when collaborating with my colleagues.</p>