drndivoje
drndivoje

Reputation: 319

Convert existing SVN working copy to git repository

I have SVN working copy on machine and I want to create git local repository from it. After that I want to be able to push my changes from newly created local git repository to svn repository. My idea is to avoid cloning svn repository via git-svn because it would take some amount of time.

Upvotes: 5

Views: 4105

Answers (2)

carnicer
carnicer

Reputation: 523

Been trying to use both git and svn on the same WC. It kinda works if you are already offline and can't perform a git svn clone.

It's indeed not an orthodox thing to do, but for a few commits and no branching / merging it is pretty useful.

It may be useful to properly set the ignored in both VCSs: in git, ignore .svn folder, in svn, ignore .git, and add .gitignore.

Then it's fun. To add the git commits to the svn repo, just do git checkout with the most relevant ones (or all of them).

Needless to say, it is assumed nobody else is working on the same svn branch. If not, just create a (temporary) ad-hoc branch, then merge it with the original one.

Upvotes: 1

sleske
sleske

Reputation: 83609

My idea is to avoid cloning svn repository via git-svn because it would take some amount of time.

Sorry, but there's no way around that.

The git repository created by git svn clone will contain the complete history of the SVN repo (unless you limit the clone process). That information is not contained in your SVN working copy, so git svn clone must fetch it from the SVN server.

Upvotes: 4

Related Questions