2012年2月23日 星期四

SVN folder as sub module of GIT

這是上一篇中 '方法B' 的筆記

1) Prepare svn:// protocol:

(NOTE: don't use file:/// because it might has file format compilable problem)

In my case:

    1. svn repo at d:\work\repo\my_projects

    2. set svn service (I had set root at d:\work\repo) and make sure service was activated

    3. test svn checkout from svn://localhost/my_projects (or relative to yout root  in step2) has no polblem

    where repo tree is like:

    svn://my_projects/bla1/...
                     /bla2/...
                     /src/boo1/...
                     /src/boo2/...
                     /src/boo3/...
                     /src/...


    (NOTE: I don't use /trunk /branches /tags naming layout)
 

2) Purpose: 

the svn://my_projects/src/boo3/* is the library part, I need it to be used as

a git clone where in d:\work\my_test\boo3-clone

so git://d:\work\my_test\boo3-clone

will sync to/and from svn://localhost/my_projects/src/boo3


3)  using msysgit:

1. use GIT for windows' 'GIT bash here' at d:\work\my_test

2. use 'git svn clone url_of_svn_repo folde_rname

(NOTE: if using /trunk /branches /tags naming layout, use 'git svn clone -s ...' as -s is -stdlayout)

3. in my case

$ git svn clone svn://localhost/my_projects/src/boo3 boo3-clone
Initialized empty Git repository in d:/work/my_test/boo3-clone/.git/
r75 = 1324d83fab0b6d93f526b8f8252e8404d49c9e08 (refs/remotes/git-svn)
        A       boo3.vcxproj.user
...
        A       boo3.dsw
        A       boo3.vcxproj.filters
        A       boo3.dsp
r80 = 9f6afc8b5c2d68c4901de44a99e946b9edab5926 (refs/remotes/git-svn)
..
        M       boo3.dsp
r81 = cbb1be75466bfb695c76c8366828af3fd7c03a80 (refs/remotes/git-svn)
Checked out HEAD:
  svn://localhost/my_projects/src/boo3 r81


4. so now d:\work\my_test\boo3-clone had filled as a git repo where all files/folders/logs

   are the same as svn's

Ref: 使用 git-svn 整合 git 與 svn



 4) Another example by using TortoiseGit:

1. git svn clone setup


2. git svn clone done


3. add submodule


沒有留言:

張貼留言