Problem importing svn repositories to bitbucket


I'm tryign to migrate from SVN to Bitbucket/Git. I'm running the procedures outlined at , and it works fine for most of my projects, however one of them isn't working.

I can clone the project initially, but when I then try to clean it (during which it creates local branches for everything), it fails, and leaves the repository unusable.

I think the problem is it tries to import a particular branch, and this causes the issue. I'm not sure whether the branch name is too long or something, but it could be.

From the svn-git-migration.log:

git branch -f -t Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service refs/remotes/Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20We$


Creating the local branch 'Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service%20when%20get%20a%20365%20days%20duration%20quote%20from%20CTI' for Sub$

git branch -f -t Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service%20when%20get%20a%20365%20days%20duration%20quote%20from%20CTI refs/remotes/Webis$




# Checking for obsolete tags...

svn ls



git for-each-ref refs/tags/ --format=%(refname)

java.lang.RuntimeException: Nonzero exit code: 128

at scala.sys.process.BasicIO$Streamed$.next$1(BasicIO.scala:32)

at scala.sys.process.BasicIO$Streamed$$anonfun$apply$3.apply(BasicIO.scala:35)

at scala.sys.process.BasicIO$Streamed$.next$1(BasicIO.scala:32)

at scala.sys.process.BasicIO$Streamed$$anonfun$apply$3.apply(BasicIO.scala:35)

at scala.sys.process.BasicIO$Streamed$$anonfun$apply$3.apply(BasicIO.scala:35)

at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.lines(ProcessBuilderImpl.scala:143)

at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.lines(ProcessBuilderImpl.scala:106)

at com.atlassian.svn2git.Git.lines(Utils.scala:121)

at com.atlassian.svn2git.Git.forEachRefFull(Utils.scala:87)

at com.atlassian.svn2git.Git.forEachRef(Utils.scala:89)

at com.atlassian.svn2git.Tags$.checkObsolete(Tags.scala:88)

And the .git/config is left ending

[branch "Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service"]

remote = .
merge = refs/remotes/Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service
[branch "Webissues(000295)%20%20-%20NullPointerException%20for%201Cover%20Web%20Service%20when%20get%20a%20365%20days%20duration%20quote%20from%20CTI"]
remote = .

i.e. without a merge = line for that branch - which then means the whole repository is broken and won't load. If you subsequently try to do any git operation, you get an error line:

fatal: bad config file line 85 in .git/config

85 is the last [branch …] line. I've tried manually adding the merge = to the config file, but it makes no difference.

Does anyone know what this might be?



2 answers

This widget could not be displayed.

I have "solved" this by simply removing the offending line from the .git/config file. I suspect however that were I to re-clean the project, it would fail again for the same reason.

This widget could not be displayed.

Hi Pete,

So there's actually nothing really "wrong" with that remote property as such. The issue is that git can't parse a branch in the config with a length greater than ~122.

This is made worse by git-svn expanding spaces to %20.

There is definitely another question about whether we should be creating those branch entries in the first place, but one benefit is that we can then accurately perform sync-rebase by looking up the git-svn branch name. I'll try to update our svn migration scripts to either truncate long branches or at least warn/error in these cases with a better message. The former might be hard to do because that would then confuse git-svn on the next fetch.


Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 10, 2018 in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

263 views 14 2
Join discussion

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