Error synchronizing SVN to Git

Simon January 20, 2014

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

0 votes
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2014

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

Simon January 21, 2014

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.

0 votes
Kevin Wiesmüller April 24, 2014

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 Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events