Difference between revisions of "Git svn"

From relax wiki
Jump to navigation Jump to search
Line 6: Line 6:
  
 
  md C:\relax\svn\trunk
 
  md C:\relax\svn\trunk
  svnadmin create --pre-1.4-compatible C:/relax/svn/trunk/.svn
+
  svnadmin create --pre-1.4-compatible C:/relax/svn/trunk
  
 
  md C:\relax\svn\branches\relax_disp
 
  md C:\relax\svn\branches\relax_disp
  svnadmin create --pre-1.4-compatible C:/relax/svn/branches/relax_disp/.svn
+
  svnadmin create --pre-1.4-compatible C:/relax/svn/branches/relax_disp
  
  echo exit 0 > C:/relax/svn/trunk/.svn/hooks/pre-revprop-change.bat
+
  echo exit 0 > C:/relax/svn/trunk/hooks/pre-revprop-change.bat
  echo exit 0 > C:/relax/svn/branches/relax_disp/.svn/hooks/pre-revprop-change.bat
+
  echo exit 0 > C:/relax/svn/branches/relax_disp/hooks/pre-revprop-change.bat
  
  svnsync init file:///C:/relax/svn/trunk/.svn http://svn.gna.org/svn/relax/trunk/
+
  svnsync init file:///C:/relax/svn/trunk http://svn.gna.org/svn/relax/trunk/
  svnsync init file:///C:/relax/svn/branches/relax_disp/.svn http://svn.gna.org/svn/relax/branches/relax_disp/
+
  svnsync init file:///C:/relax/svn/branches/relax_disp http://svn.gna.org/svn/relax/branches/relax_disp/
 
  # Be aware, if your repo is big, it could take a loooot of time.
 
  # Be aware, if your repo is big, it could take a loooot of time.
 
  # Example. 20500 commits, took from 22 PM to 23 PM.
 
  # Example. 20500 commits, took from 22 PM to 23 PM.
  svnsync sync file:///C:/relax/svn/trunk/.svn
+
  svnsync sync file:///C:/relax/svn/trunk
  svnsync sync file:///C:/relax/svn/branches/relax_disp/.svn
+
  svnsync sync file:///C:/relax/svn/branches/relax_disp
  
 
  cd C:\relax
 
  cd C:\relax
  git svn clone file:///C:/relax/svn/trunk -s
+
  git svn clone file:///C:/relax/svn/trunk
  git svn clone file:///C:/relax/svn/branches/relax_disp -s
+
  git svn clone file:///C:/relax/svn/branches/relax_disp
  
 
=== Test 2 ===
 
=== Test 2 ===

Revision as of 09:31, 21 July 2013

Background

Windows

Test 1

Based on this and this article.

md C:\relax\svn\trunk
svnadmin create --pre-1.4-compatible C:/relax/svn/trunk
md C:\relax\svn\branches\relax_disp
svnadmin create --pre-1.4-compatible C:/relax/svn/branches/relax_disp
echo exit 0 > C:/relax/svn/trunk/hooks/pre-revprop-change.bat
echo exit 0 > C:/relax/svn/branches/relax_disp/hooks/pre-revprop-change.bat
svnsync init file:///C:/relax/svn/trunk http://svn.gna.org/svn/relax/trunk/
svnsync init file:///C:/relax/svn/branches/relax_disp http://svn.gna.org/svn/relax/branches/relax_disp/
# Be aware, if your repo is big, it could take a loooot of time.
# Example. 20500 commits, took from 22 PM to 23 PM.
svnsync sync file:///C:/relax/svn/trunk
svnsync sync file:///C:/relax/svn/branches/relax_disp
cd C:\relax
git svn clone file:///C:/relax/svn/trunk
git svn clone file:///C:/relax/svn/branches/relax_disp

Test 2

Based on these posts and on these posts.

  • -r is for the revision to start taking history from. If you want to include all of the history, just leave that option off, but it will take a very long time, and you really don't need all of it. The older a revision you choose, the longer it will take to import. But you will not be able to "git blame" past the earliest revision you import. Choose wisely.
md C:\relax
cd C:\relax
git svn clone -r 20000:HEAD svn://svn.gna.org/svn/relax/trunk/

This takes a clone of the repository at that revision; to update it to HEAD, you now need to rebase, which is very similar to: svn up

git svn rebase