Is there a way to add a Subversion repository as a Git submodule in my Git repository?
Something like:
git-svn submodule add https://svn.foo.com/svn/proj --stdlayout svn-project
Where https://svn.foo.com/svn/proj points to a Subversion repository.
I know there is git-svn which allows one to interact with a Subversion repository. So I am thinking, maybe there is a way to checkout a Subversion repository with git-svn and then use it as a submodule.
No. Your best bet would be to set up a mirror of the svn repository in a dedicated git repository.
Then you can add the git repository as a submodule to the original project
There is one conceptual difference between svn:externals and git submodule that may trip you up if you approach this from a subversion point of view. The git submodule is pegged to the revision that you give it. If ‘upstream’ changes, then you have to update your submodule’s reference.
So when we resync with the upstream subversion:
… the git project will still use the original revision that we committed earlier. To update to the svn HEAD, you would have to use