Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to "persistently" synchronize a git repository with SVN?

Tags:

git

svn

git-svn

From what I could find around the web, it seems that using git svn is not "persisted".

Meaning, if I git svn clone a repository, then push to master and repull a fresh copy in a separate folder, the fresh copy is not aware of svn at all, and cannot be used to synchronize with SVN without reapplication of svn clone.

Is there a way around this issue?

like image 685
ripper234 Avatar asked Mar 20 '11 13:03

ripper234


1 Answers

A clone essentially just initializes a new git repository, sets up the origin remote, runs git fetch, and creates a branch based on the remote repository's HEAD. None of these operations look at the .git/svn information in the remote repository - I think that everything apart from refs, objects and HEAD in a remote repository's git directory is regarded as private.

As for a way around that, you could always rsync -a or scp -r the remote repository instead of cloning it, which should work - all the Subversion metadata should be copied.

However, personally I've always found it less confusing to just have one git svn cloned repository that I do git svn dcommit from, and push back to that repository whenever I want to commit anything to Subversion. Then those other repositories are just normal git repositories and you don't need to worry about any of the restrictions of git svn until you push back to the git svn clone, at which point you normally need to do some rebasing...

like image 172
Mark Longair Avatar answered Sep 28 '22 02:09

Mark Longair