gitã®ãªãã¸ããªãSubversionã«å¤æãã
gitã§å§ããããã¸ã§ã¯ããSubversionã®ãªãã¸ããªã«ãããã£ãã®ã ããã©ããã£ããããã®ã調ã¹ã¦ãããããããªãã
Subversionããgitã¯ããããã®ã«ãã¼ã
試è¡é¯èª¤ã®çµæã¨ãããããã¾ããã£ãã£ã½ãã®ã§è¨é²ãæ®ãã¦ããã
ããã§å¤§ä¸å¤«ãªã®ãã©ããã¯ããããããªãã
ãã£ã¨id:bleis-tiftå
çããªãã¨ããã¦ãããããºï¼
gitããSubversionã¸
移è¡å ã¨ãªãæ°ããSubversionãªãã¸ããªãç¨æããã
svnadmin create foo
ãã§ãã³ãããããªãã¨ãã¾ããããªãæãã ã£ãã®ã§trunk,branches,tagsãä½ã£ã¦ããã
svn checkout http://localhost/svn/foo foo cd foo mkdir {trunk,branches,tags} svn commit -m "init"
ãªããfileã¹ãã¼ã ã ã¨git-svnããã¾ãåãã¦ãããªãã£ãã®ã§DAVã§åããããsshã¨ãã§ããããã®ããªï¼
ç¶ãã¦ç§»è¡ç¨ã®gitãªãã¸ããªãgit-svnã§ä½ãã
git svn clone -s http://localhost/svn/foo foo-migrate
masterã¯ãã£ã¨ãã¦ããã¦ãä½æ¥ç¨ã®ãã©ã³ãã«å ã®ãªãã¸ããªï¼ããã§ã¯/path/to/origï¼ã®å 容ãåã£ã¦ããã
git checkout -b migration git pull --rebase /path/to/orig
pull --rebaseãããªãã¨Subverionã®initãæå¾ã«æ¥ã¡ããã¿ãããªã®ã§ã
ãããããããã¨Subverionã®ã³ããããç¡ããªãã®ã§ãæ¹ãã¦rebaseããã
ãããªãã¨ãã¦ããã®ãããããããªãã
git rebase master
ããã§ããããæå¾ éãã®ããªã¼ã«ãªã£ãã®ã§ãmasterã«æ»ã£ã¦mergeãã¦dcommitããï¼
git checkout master git merge migration git svn dcommit
ããã§Subversionã®ãªãã¸ããªã«ä»ã¾ã§ã®æ´å²ãåæ ãããã¨ãã§ããï¼
ãã¨ã¯ãã®ã¾ã¾ãªãã¸ããªã使ããè¯ããæ¹ãã¦git svn cloneãããããã
ã¨ã¾ããããªæãã§ãã¡ãã移è¡ã¯ã§ããã¿ããã
ãã©ã³ããã¿ã°ã¯gitã§ã¯ã¾ã é常ã®éç¨ããããã¨ããªãã®ã§ç§»è¡ã®ãããã¯ããããªãã
ãã¨å¾åããªãããã ãã ãªæãã§æ¹åã®ä½å°ããããããªæ°ãããã
format-patchã使ã£ãæ¹æ³
ä¸è¨ã®æ¹æ³ã¯ãã¾ãã¡ç¢ºä¿¡ãæã¦ãªãã®ã§ãããããããformat-patchã使ã£ãæ¹æ³ã®ã»ããå®å ¨ãããããªãã
ããæ¹ã¨ãã¦ã¯git svn cloneããã¨ããã¾ã§ã¯åãã§ããã®å¾å ã®ãªãã¸ããªããªã¢ã¼ãã«ç»é²ãã¦ããããä½ãâé©ç¨ããã¨ããæµãã«ãªãã
git svn clone -s http://localhost/svn/foo foo-migrate git remote add orig /path/to/orig git fetch orig
ããããä½ã£ã¦ããããé©ç¨ã
git format-patch -o ../foo-patches master..orig/master git am ../foo-patches/*.patch
ç¡äºã«é©ç¨ã§ãããSubversionã¸dcommitï¼
git svn dcommit