Diego
Diego

Reputation: 7562

Can I have an SVN Repo as a source for a GIT Repo

I have a project in an SVN source, which will have to be migrated to a Git repository. What I'd like to do is committing all changes to Git repo from now on, while still fetching eventual changes from SVN, until it's dismissed.

At the moment, I created the Git Repo, used git svn to clone it from the original SVN and pushed everything into Git. Issue is, if I do a Pull, I'm fetching the modifications from Git, which is not what I want.

In practice, I'm trying to "fork" the SVN repository into Git and tracking SVN changes. Is it possible to do that?

Thanks in advance for the answers.

Upvotes: 0

Views: 77

Answers (3)

Dmitry Pavlenko
Dmitry Pavlenko

Reputation: 8958

If you want to use Git while letting 3rd parties to use your SVN repository, you can simply use any transparent Git<->SVN gateway, like SubGit. You will continue with Git forgetting about SVN, and SVN-users will never know you have a Git interface.

Upvotes: 1

alternative
alternative

Reputation: 13002

Currently, there is git svn rebase, as mentioned, which will allow you to get upstream changes from svn.

Note that there is currently a GSoC project for adding svn remotes. Its on its fifth version of the patch series at the moment.

git svn rebase will cause you extreme problems, though, for example if you push to a public repository and git svn rebase. For this reason you cannot push changes not in svn to the main git repository.

Upvotes: 1

jolivier
jolivier

Reputation: 7635

Yes you can do that, in your git repo, the master branch is tracking git-svn so when you run git svn rebase it updates master with the content in SVN. In this same repository you can have another branch which merges regularly master but contains modifications that will not be sent back to SVN.

While migrating from svn to git we have the same workflow than described in this answer.

Upvotes: 1

Related Questions