简体   繁体   English

将 SVN 迁移到 Git

[英]Migrating SVN to Git

I am trying to migrate my svn repository to git.我正在尝试将我的 svn 存储库迁移到 git。

I am using Atlassian's migration instructions我正在使用Atlassian 的迁移说明

  1. First I got my authors and mapped them首先,我找到了我的作者并绘制了它们的地图

    java -jar ./svn-migration-scripts.jar authors $SVN_ROOT/$SVN_PROJECT > authors.txt java -jar ./svn-migration-scripts.jar 作者 $SVN_ROOT/$SVN_PROJECT > author.txt

  2. Then I did an svn clone然后我做了一个 svn clone

    git svn clone --stdlayout --prefix='' --authors-file=authors.mapped.txt $SVN_ROOT/$SVN_PROJECT working.git git svn clone --stdlayout --prefix='' --authors-file=authors.mapped.txt $SVN_ROOT/$SVN_PROJECT working.git

  3. Then clean-git然后清理git

    java -Dfile.encoding=utf-8 -jar ../svn-migration-scripts.jar clean-git --force java -Dfile.encoding=utf-8 -jar ../svn-migration-scripts.jar clean-git --force

It fixes the branches它修复了树枝

$git branch
gary1
* master

But not the tags但不是标签

Here is my remote branches:这是我的远程分支:

$git branch -r
gary1
origin/gary1
origin/master
tags/0.1.0+13
tags/0.1.0+24
tags/0.1.0+5
trunk
trunk@64018
trunk@64019

Any advise?有什么建议吗?

It looks like the Atlassian tool has changed your tags to branches.看起来 Atlassian 工具已将您的标签更改为分支。 The easy fix would be to check out the tag branch简单的解决方法是检查标签分支

git checkout tags/0.1.0+13

Then create the needed tag on the head of that branch然后在该分支的头部创建所需的标签

git tag -a v0.1.0.13

Then merge into the appropriate branch https://git-scm.com/docs/git-merge然后合并到相应的分支https://git-scm.com/docs/git-merge

git checkout master
git merge tags/0.1.0+13

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM