docs:git:importing_an_svn_repository

importing an svn repository

  1. create a text file somewhere (~/Desktop/users.txt) to map the svn users to git users
    jdoe = John Doe <jdoe@example.com>
  2. create a project directory, and change to it
    mkdir myproject.git
    cd myproject.git
  3. initialize an empty git repository
    git svn init -s http://host/path/to/your/svn/repo/project/trunk --no-metadata
    • note the -s flag sets the default svn structure for /branches /tags /trunk; if this isn't how your repo is set up, you can use the -T -b -t flags
  4. set up the user file for mapping
    git config svn.authorsfile ~/Desktop/users.txt
  5. import the svn repository
    git svn fetch
  6. sync with svn (like running svn update)
    git svn rebase
  7. use the master branch to push to svn, and create git only branches for your local development
  8. when you have a commit on the master branch ready to push to svn, do this
    git svn dcommit
  9. since it takes so long to pull full svn history into a git repo, you may want to do this once and then set up a git repo that others can clone, if other users want to use git on a large project
  • docs/git/importing_an_svn_repository.txt
  • Last modified: 2010/09/20 10:09
  • by billh