3

I've cloned a replicated svn repository (svnsync to local file system). All the branches etc. are now available in git. Now i would like to start working on svn branches

git checkout remotes/B_XYZ

and doing some commits via git. Now i want to change to a different SVN branch via

git checkout remotes/B_ABC

and doing some changes as well.

And now the final question is: Is it possible to commit the changes i made on the branches (in git) to the original Subversion repository back on the appropriate branches?

3 Answers 3

2

Is git svn dcommit not working for you?

Sign up to request clarification or add additional context in comments.

3 Comments

But as far as i understand the doc the git svn dcommit will commit to the location where i cloned from which is a local repository which i synced. But i would like to dcommit the changes to a different repository (e.g. svn.exz.de)?
Sorry, I didn't understand that part at first. You could probably manually add some remotes, but to me it would be easier to set up a new git svn integration (one that actually talks to the true svn repo, not a copy) in a separate repository and then git cherry-pick the changes over into it.
I used a replicated SVN repository, cause the original is currently down. That's the reason to use the replicated SVN repos instead of the original.
2

After some experiments i figured out how to do the commit to the new repository which is not the replicated one.

git svn dcommit --commit-url URL/branches/BRANCHNAME

With the command above i can commit the changes i made in git into the new svn repository.

Comments

0

It is possible if you install SubGit into your SVN repository and use it instead of git-svn. It will create a pure Git repository (not git-svn repository!) for you such that any push to it will result into SVN commit and vice-versa (triggered by hooks). Any new branch push will create a branch in SVN, any tag push will create a tag.

The only restriction is that you should have an access to your SVN repostiory, but is seem it's exactly your case.

To do that run

$ subgit install path/to/svn/repostiory

The linked Git repository will be in path/to/svn/repostiory/.git.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.