Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

During Git migration new branches in SVN are not syncing to Git

JeffN September 11, 2013

I've been following the excellent blog tutorials on the SVN to Git migration. In the tutorial under Preparation: Step 2 there is the following comment:

# If you plan on making _any_ more changes to your SVN repository please run the following

I took this to mean we could continue to use SVN OnDemand and that the sync process outlined could capture new branches. Is this possible?

We are at a stage where we have created a SVN repo from the OnDemand dump and new code is synced to Bitbucket every 15 min.

The problem is that NEW branches created in SVN after the time the dump was created do not show up in the local git repo to be pushed out to Bitbucket. (New code on trunk does.)

Our sync script is rather simple, basically:

svnsync sync file:///created_from_dump/local-svn/

# Sync local SVN to local Git
git-svn fetch && java -Dfile.encoding=utf-8 -jar /.../svn-migration-scripts.jar sync-rebase

# Push new code/branches/tags
git push --all bitbucket-ssh -u
git push --tags bitbucket-ssh


1 answer

0 votes
JeffN September 11, 2013

Ok, I think I may have found a partial answer. It looks like earlier in the "Clean up" process new local git branches are created from the remote branches using the following:

java -Dfile.encoding=utf-8 -jar svn-migration-scripts.jar clean-git --force

I found using 'git branch -a' that I DO have remote branches corresponding to our newly created SVN branches, however I've already run this clean utility once before and the dry run output for a second run seems to suggest remaking all of the branches that were made last time plus dozens more with ascending numbers appended.

Ex:

# Creating local branches...
Creating the local branch 'developer-branch_01' for Subversion branch 'refs/remotes/developer-branch_01'.
... Creating the local branch 'developer-branch_25' for Subversion branch 'refs/remotes/developer-branch_25'.

When I check the current SVN repo, I do not see branches corresponding to any of these developer branches.

Is it ok to run the clean-git command in the sync script and run it multiple times all day long? (This is the svn-migration-scripts clean-git tool discussed in the Atlassian blog on migration.)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events