Error synchronizing SVN to Git

I'm using the SVN to Git migration guide:

https://www.atlassian.com/git/migration#!migration-synchronize

So far everything has gone well. The Git repository was created and I have synchronized several times to keep the repository up to date with SVN.

However, today I am unable to syncronize and unfortunately I am not yet knowledgable enough about Git to understand what might cause this error.

I ran 'git svn fetch' successfully, but then when I tried to rebase using the Attlassian SVN migration scripts I got the following error. Is this a bug with the Atlassian SVN migration scripts?

$ java -Dfile.encoding=utf-8 -jar ../svn-migration-scripts.jar sync-rebase
fatal: ambiguous argument 'heads/(detached from 22ff5b8)': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
An unexpected error occured, please attach /tmp/svn-git-migration.log to any related support issue
Exception in thread "main" java.lang.RuntimeException: Nonzero exit value: 128
	at scala.sys.package$.error(package.scala:27)
	at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:131)
	at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:101)
	at com.atlassian.svn2git.Git.$(Utils.scala:127)
	at com.atlassian.svn2git.SyncRebase$$anonfun$apply$2.apply(SyncRebase.scala:31)
	at com.atlassian.svn2git.SyncRebase$$anonfun$apply$2.apply(SyncRebase.scala:30)
	at scala.collection.immutable.Stream.foreach(Stream.scala:291)
	at com.atlassian.svn2git.SyncRebase$.apply(SyncRebase.scala:30)
	at com.atlassian.svn2git.Main$$anonfun$7.apply(Main.scala:57)
	at com.atlassian.svn2git.Main$$anonfun$7.apply(Main.scala:52)
	at scala.Either.fold(Either.scala:44)
	at com.atlassian.svn2git.Main$delayedInit$body.apply(Main.scala:47)
	at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.App$$anonfun$main$1.apply(App.scala:60)
	at scala.App$$anonfun$main$1.apply(App.scala:60)
	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
	at scala.collection.immutable.List.foreach(List.scala:45)
	at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30)
	at scala.App$class.main(App.scala:60)
	at com.atlassian.svn2git.Main$.main(Main.scala:22)
	at com.atlassian.svn2git.Main.main(Main.scala)

2 answers

1 accepted

Hi Simon,

Looks like the migration scripts aren't handling the case where you are in an "detached head" state (ie. you're not on a branch). What branch were you on when you ran sync-rebase? If you checkout master and run the scripts again does it work?

Cheers,

Charles

Thanks, that solved it. Not sure how I ended up in a detached head state (I didn't knowingly switch branch), but running 'git checkout master' then re-running the scripts solved the problem.

I got the same Problem with the Plugin but i do not understand how I should run them again, I can not access my stash repo to delete it or do anything because of the error "Detached heads are not supported" what should i do? how can i delete the repo?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

706 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot