migrate to git from svn -


i want migrate svn server git , move git.

my svn repository contain several folder each 1 contain difference project.

i cloned svn repository git using git svn tried split each of folders difference branch using command: git subtree split -p name-of-folder -b name-of-new-branch.

the problem in part of history mvoed 1 of folder other location , history in git repository keeped position.

i can not see history after run git svn clone

my svn layout this:

svnrepo/   foldera/       projecta files(.sln,.cpp)   folderb/       projectb files(.java)   folder/       folderc/           folderc files(.cs)       folderd/           folderd files(.cs) 

i want branch folder branch folderb branch folderc , branch folderd.

edit: in point of project moved folderc , folderd this:

    folder/        web/           folderc/               folderc files(.cs)           folderd/               folderd files(.cs) 

then when try clone url of folderc history point moved folderc web although there lot of history before.

is there way save history previous location?

git-svn has options deal svn branches , tags, they're documented in init not clone. git svn clone git svn init plus git svn fetch , takes options.

for typical svn layout...

svnrepo/     trunk/     branches/         branch1/         branch2/     tags/         tag1/         tag2/ 

you can tell git-svn layout --trunk, --tags , --branches. git svn clone --trunk=trunk/ --tags=tags/ --branches=branches/ <svnurl>. there's shortcut standard layout, --stdlayout.

for op's non-standard layout...

svnrepo/   foldera/       projecta files(.sln,.cpp)   folderb/       projectb files(.java)   folder/       folderc/           folderc files(.cs)       folderd/           folderd files(.cs) 

it git svn --branch=foldera --branch=folderb --branch=folder/folderc --branch=folder/folderd. op's description, these sound more separate projects, not branches of single project. should separate git repositories.

svn repositories expensive setup , maintain, svn encourages shove unrelated projects 1 repository. git repositories super cheap, git works best when each project own repository. when convert, it's best split each project own git repository. later can stitch related projects git subtree if find need it.

for svn repository multiple projects want turn multiple git repositories, run git svn clone multiple times on each svn directory, check them out svn.

git svn clone https://svn.example.com/foldera/ git svn clone https://svn.example.com/folderb/ git svn clone https://svn.example.com/folder/folderc/ git svn clone https://svn.example.com/folder/folderd/ 

pro git has chapter on converting svn git more.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -