Using git with svn

I have to use svn as source code management tool, but I want to use git branches locally. I wonder if it works without problems and what’s the best approach. I read about ‘git svn‘, but it looks like I would have to sync the whole svn repositoy to use it. That’s not an option. Assuming I’m the only developer (not git push/pull between developers) and want to use git only ‘locally’. What’s the best approach? Just ‘git init’ on my local checked out project? And to use both tools in the same folder? Are there better approaches?

  • How to git clone a repo in windows from other pc within the LAN?
  • What does “@@ -1 +1 @@” mean in Git's diff output?
  • Git clone. key_load_public: invalid format Permission denied (publickey)
  • TortoiseGit Fail to install context menu on Windows 7
  • Is there a “theirs” version of “git merge -s ours”?
  • How to use GIT interactive rebase for signing off a series of commits
  • Eclipse project with Subclipse: Introduce trunk and branches
  • Which style do you use for your commit messages? Technical or feature-based?
  • Git create branch where detached HEAD is
  • git and vimdiff - close all files at once
  • How do I check out an SVN project into Eclipse as a Java project?
  • Find all the commits there are in lab branch but in master branch
  • 3 Solutions collect form web for “Using git with svn”

    You do not need to sync the whole repository. You can clone the modules you require:

    git svn clone --stdlayout http://myrepo/module

    That will pull down the whole history for that module. You can just grab HEAD:

    git svn clone --stdlayout -r HEAD http://myrepo/module

    This is how I work most days.

    There are lots of related questions about git-svn workflow… just follow the links to the right of this answer 🙂

    Use git svn. You don’t have to sync whole repository—you can sync only particular branches and you can skip old history. However, you need to sync all revisions since than on the selected branches. It would be much less useful without that.

    You don’t have to clone the whole tree, just do a shallow clone. See How to git-svn clone the last n revisions from a Subversion repository?

    Git Baby is a git and github fan, let's start git clone.