简体   繁体   中英

Strategy for using git-svn with submodules

I would like to use Git locally, with submodules, and be able to push/pull from SVN (The company I'm at uses SVN, and a switchover to Git is nowhere in the near future). I know git-svn doesn't support this, but I'd like to be able to trick it with perhaps a shell script. Any ideas?

You cannot use git-svn because it doesn't allow to work with git submodules. But I can propose alternative solutions:

First have a look at SmartGit : it introduces a concept of SVN submodules . svn:externals property is converted to a version-controlled .gitsvnextmodules file that specifies SVN submodules list. To enable submodules support just clone your basic repository with SmartGit from scratch (if you just open already cloned git-svn repository, SmartGit will be in compatibility mode, and externals support will be turned off).

If you prefer pure Git rather that git-svn and have access to the server, you may install SubGit into the SVN repository. It will create a Git interface for the SVN repository (actually a separate Git repository that will be automatically synchronized with SVN). After that you may add pure Git modules using this pure Git interface (I assume your external repositories also have Git interface, because you ask about Git submodules). Git submodules will live only in Git version of the repository and won't be translated to SVN.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM