It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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.

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
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

4,083 views 4 22
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you