Reputation: 135
At work I own a relatively small software tool (~25k lines of java), and I have been using a Git repo to revision it. Now the tool is going to be part of a larger package that is maintained in a totally different environment by other people, which uses SVN. But I still want to maintain the flexibility of my Git repo, so that I am not rigidly tied to the larger package's release schedule.
Is there a way I can keep my local area in sync with both revision control systems in a way that avoids uploading .svn
files to git, and .git
files to SVN? Ideally I'd want to keep committing the minor edits to Git, and then periodically push to SVN when requested, all from the same directory. Or am I doomed to keep copying files between two directories on my system?
Upvotes: 0
Views: 315
Reputation: 83609
Your best option is probably to use git-svn
. This allows you to use git
as a frontend for a Subversion repository.
The simplest way to do this would be:
svn commit
)git svn clone
to fetch the software as a git repositoryThe disadvantage is that you lose the git history you have created so far.
If you want to keep the git history, things will get a bit more complex (because SVN cannot represent some aspects of git's history, particularly branches). Basically you'd:
git svn clone
git svn dcommit
)The "import your existing git commits" is where things will get tricky (for example, you will have to rebase on top of the initial commit in the git svn
repo, then git svn dcommit
will rebase again, which will play havoc with merge commits. However, if you can live with e.g. branches not being represented totally faithfully, you should be fine.
Upvotes: 1