jaygooby
jaygooby

Reputation: 2536

Git submodule not updating from a git-svn repository

I have a projectx which includes a git submodule

/projectx/foo/bar/submodule

The submodule repository is itself a git-svn repo which tracks an svn repository.

In the standalone submodule repo, I've pulled in some new updates:

git svn fetch

and I see some revisions come in. So I run:

git svn rebase master

and when I call:

git status

It all looks fine. So in the root of my projectx I run:

git submodule update

and nothing happens. What am I doing wrong? I've definitely run:

git submodule add
git submodule init

on the submodule, and when I run:

git submodule status

I see the hash for its status.

So why does git submodule update not cause any update to happen?

Upvotes: 2

Views: 2224

Answers (1)

Mark Longair
Mark Longair

Reputation: 468191

Unfortunately, git submodule update causes a git fetch to be run in the submodule rather than git svn fetch. The easiest solution is to keep your git-svn clone of the subversion repository elsewhere, and then add that repository as a submodule. That is the suggestion in this similar question:

Presumably if you want anyone else to use your repository, that's what you'd want to do anyway, since .gitmodules can only point to a git repository, not an SVN repository.

Of course, nothing stops you from just manually running a git svn rebase in your submodule directory and then adding and committing whatever version you like in the supermodule. However, the URL in .gitmodules will need to point to that repository, or a clone of it.

Upvotes: 3

Related Questions