We are testing out using git as a repository system instead of our normal svn. There is one svn repository that we always need. In svn we link this repository with svn propset as a svn:externals. This ensures there is really only one global copy of that particular, heavily used, repository.
Now that we have git repositories, I would like to link the SVN repository to it in essentially the same way as one can with svn:externals. I have somewhat succeeded in doing this. I am new to git, please excuse any ignorance.
In the pure git repo (which I clone via git clone gitmaster@address.org:mygitrepo
) I used:
git svn clone svn+ssh://svnowner@hostname.org/path/to/mysvnrepo mysvnrepo
to get a copy of the other svn repository. This works great, I can get new revisions to the SVN repo via git svn rebase
in the mysvnrepo directory and commit changes via git svn dcommit
.
To combine this to the main git repository I used:
git add mysvnrepo
git commit mysvnrepo
git push
The issue I am having is if I now clone the git repo somewhere else (again with git clone gitmaster@address.org:mygitrepo
), while I get the mysvnrepo directory with all the files, I cannot interact with the SVN repo. I get the error: "Unable to determine upstream SVN information from working tree history" after git svn rebase. Possibly related, there is no .git folder in the mysvnrepo directory when I clone it elsewhere (this is where the svn info is stored in the original repo).
I have searched this problem out a bit but all references to it seems to get problems getting the svn repo to work in the first place, whereas my problem is getting it to work for another user.
Perhaps my problem is how to successful add/commit/push the svn repo to the git repo? i.e. is: git add mysvnrepo; git commit mysvnrepot; git push
; the correct way to do this?
Edit: improved to give more context