Clone multiple SVN projects with git-svn

删除回忆录丶 提交于 2019-12-19 03:09:56

问题


I have a large Java app that is split up into multiple projects. Each project has its own folder in a Subversion repository like so:

AccountingCore

  • trunk
  • branches
  • tags

Common

  • trunk
  • branches
  • tags

WebCommon

  • trunk
  • branches
  • tags

etc...

I want to start using git-svn locally instead of subversion.

This may be a stupid question, but is there a way to checkout all the projects in the repository at once (including branches and all) instead checking out each project individually?

Thanks, Tony


回答1:


If you have a shell, you could enter

for DIR in AccountingCore Common WebCommon; do mkdir $DIR; cd $DIR; git init; git svn init -s svn://host/path/$DIR; git svn fetch; cd ..; done

That is, if I made no mistakes.




回答2:


Just to improve on earlier answer, instead of

for DIR in AccountingCore Common WebCommon; do ...

do

DIRS=`svn ls svn://host/path`; for DIR in $DIRS; do ...



回答3:


Yes. just checkout at the root path. If your repo is hosted here:

svn://host/path/AccountingCore svn://host/path/Common svn://host/path/WebCommon

Then do your git svn command on svn://host/path.



来源:https://stackoverflow.com/questions/279144/clone-multiple-svn-projects-with-git-svn

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!