1

I've been working for some time with SVN and I'm now in the process of migrating to GIT, for rather obvious reasons. I can already create the git repository out of the svn one.

As I'm not very confident with GIT, before to effectively choose it as my versioning system, I want to keep the SVN repository synchronized with the GIT one, while working with GIT.

I'm quite able to do this, through post push hooks, but I have the following issues:

1) The svn commit is done by the same user (the one that controls the GIT repository from which the dcommits are performed).

2) In order for git svn to evaluate the new differences to commit on the SVN, it changes the GIT commit metadata by adding an ugly "git-svn-id". This alters the commit-sha and therefore requires an additional git pull which moreover creates a "diamond" in the repository tree.

Is there a way to avoid this?

Note that I could be satisfied by just ensuring a one side synchronization (from GIT to SVN), whereas the opposite does not have to hold.

Thanks in advance.

1 Answer 1

1

1) You can configure your local GIT repository to map back and forth between SVN users and GIT authors by creating an authors text file with the format:

svnjohndoe = John Doe <[email protected]>

You'll have to tell git svn clone to use it by specifying the --authors-file option:

$ git svn clone http://someproject/svn --authors-file=authors.txt

2) You can avoid the git-svn-id in your commits up front by cloning the SVN repository with the --no-metadata option:

$ git svn clone http://someproject/svn --no-metadata

Unfortunately, there's no way to avoid the git-svn-id when pushing back to SVN.

However, a workaround to avoid having the commits SHAs changed is to push first to SVN (through git svn dcommit) and then push to your upstream GIT repo.

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

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.