4

Clone of SVN repo to Git repo works fine.
However i have problem with

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

Command listed above should convert all remotes tags into local ones.
But i recieve:

# Creating annotated tags...
tag has diverged: 1.0_RC1
Creating annotated tag '1.0_RC1' at refs/remotes/tags/1.0_RC1.
# Creating local branches...
# Checking for obsolete tags...
svn: E215004: Authentication failed and interactive prompting is disabled; see t
he --force-interactive option
svn: E215004: Unable to connect to a repository at URL 'http://127.0.0.1/svn/dri
veLearner/tags'
svn: E215004: No more credentials or we tried too many times.
Authentication failed
Deleting Git tag '1.0_RC1' not in Subversion.
Deleted tag '1.0_RC1' (was d200bf6)
# Checking for obsolete branches...
svn: E215004: Authentication failed and interactive prompting is disabled; see t
he --force-interactive option
svn: E215004: Unable to connect to a repository at URL 'http://127.0.0.1/svn/dri
veLearner/branches'
svn: E215004: No more credentials or we tried too many times.
Authentication failed
No obsolete branches to remove.
# Cleaning tag names
# Cleaning branch names

I use local winXP, java 1.7_65, VisualSVN Server(http, port 80). Repo is available for Everyone in read/write mode.
Funny thing is i've done this process but on other repo succesfully after the same problems, but i don't know what i've done.
Have somebody some solution?

2

3 Answers 3

8

This svn-migration-script.java from Atlassian is a crap. Here is detailed instruction how to migrate from SVN to Git with minimum of third party soft and with preserve local branches and tags.

DETAILED TUTORIAL:
[this original link is dead] http://www.sailmaker.co.uk/blog/2013/05/05/migrating-from-svn-to-git-preserving-branches-and-tags-3/
[possible replacement] https://blog.redbranch.net/2015/06/12/migrating-from-svn-to-git-with-branches-and-tags/

SVN server:
url: [svn_address]/[project_name]/[project_name]
user: [user]
pass: [pass]
(access for user [user]: rw)

target:
c:[eclipse_workspace][project_name] (create directories if don't exist)

Procedure:
++ install svn and git (with Git Bash) in your system (optionally add their 'bin' directories to PATH)
++ make sure svn serwer works in http mode (not in https)
++ make authors.txt if necessary
++ clone svn to git: git svn clone --stdlayout --authors-file=c:\authors.txt
[svn_address]/[project_name] c:[eclipse_workspace][project_name] [user] [pass]
command rebase -b 0x64000000 "c:\program files\git\bin\libsvn_repos-1-0.dll" (or analogical) can be useful if some error with mapping will appear
++ run Git Bash from context menu (you should have installed this)
++ type git branch -a to check your branches and tags
++ type in Git Bash:

to attach branches:

for branch in `git branch -r | grep "branches/" | sed 's/ branches\///'`; do
  git branch $branch remotes/branches/$branch
done

to attach tags:

for tag in `git branch -r | grep "tags/" | sed 's/ tags\///'`; do
 git tag $tag remotes/tags/$tag
done

++ create bare git repository and push there [project] (you will loose SVN dependencies)
++ clone [project] to target location

Sign up to request clarification or add additional context in comments.

4 Comments

Small comment to this. After some time (it has taken me a little to familiarize with Git and side tools) I've noticed that this way of import of tags, creates local tag indeed but also creates a branch. Hovewer further commits are made in master.
When i would like to attach tags or branches with bash script, i have this error : "fatal: Failed to resolved 'remotes/tags/svn/tags/...' as a valid ref"
@rainbow link is broken
@w33haa I regret but I can't do anything with this. This blog wasn't mine.
1

This is how I got this working (on Mac OSX):

  1. Added credentials to corresponding ~/.subversion/auth file
  2. Tried to run svn log your-repo-url just to see if the svn auth is working
  3. On Mac this would ask me to use my keychain, I selected "Always Allow"
  4. After this my clean-git command would start working as well

There is also ticket logged here but it hasn't been given any attention from the maintainers

Comments

-1

I had same program. I used this option.

--no-delete

How to this option.

https://bitbucket.org/atlassian/svn-migration-scripts/src

If the --no-delete option is specified, branches and tags will be created but none will be removed.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.