git svn 中断,然后我丢失了所有标签,如何修复它? [英] git svn interrupted, then i lost all the tags, how to fix it?

查看:25
本文介绍了git svn 中断,然后我丢失了所有标签,如何修复它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我准备使用 git svn clone -s svn://xxx 从 svn repo (on centos) 克隆代码,然后因为奇怪的问题被中断,错误信息如下:

i am about to clone code from svn repo (on centos) using git svn clone -s svn://xxx, then it is interrupted for strange problems, the error message is as follows:

Following parent with do_switch
Successfully followed parent
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/SVN/Core.pm line 584.
Network connection closed unexpectedly:  at /usr/libexec/git-core/git-svn line 2693

然后我继续这个克隆过程使用

then i continue this clone process using

    time git svn fetch -r HEAD

一切顺利,终于成功克隆了那个svn repo:

all the things seems goes well, and succeed to clone that svn repo at last:

W: -empty_dir: trunk/src/os/win32/ngx_gui.c
W: -empty_dir: trunk/src/os/win32/ngx_gui.h
W: -empty_dir: trunk/src/os/win32/ngx_gui_resources.h
W: -empty_dir: trunk/src/os/win32/ngx_shared.h
W: -empty_dir: trunk/src/os/win32/ngx_types.h
r4817 = 7b58fc00b5b8ebb0544053ecf63e53b28935f15b (refs/remotes/trunk)
Auto packing the repository for optimum performance. You may also
run "git gc" manually. See "git help gc" for more information.
Counting objects: 12449, done.
Compressing objects: 100% (12177/12177), done.
Writing objects: 100% (12449/12449), done.
Total 12449 (delta 9475), reused 0 (delta 0)
Checked out HEAD:
  svn://svn.nginx.org/nginx/trunk r4817

real    0m9.630s
user    0m6.015s
sys     0m1.870s

奇怪的问题是我的本地 git repo 中没有标签,它是从 svn repo 克隆的:

the strange issue is that there is no tags in my local git repo which is cloned from svn repo:

[root@home nginx]# git branch
* master
[root@home nginx]# git tag   // no tags at all:(

[root@home nginx]# svn ls svn://svn.nginx.org/nginx/branches | wc -l
7
[root@home nginx]# svn ls svn://svn.nginx.org/nginx/tags | wc -l
388

事实上,svn repo 中有 388 个标签,那么如何修复我的本地 .git repo?

in fact there are 388 tags in the svn repo, so how to fix my local .git repo?

我应该从远程 svn 服务器重新启动 git clone 吗?

should i have to restart to git clone from the remote svn server?

我试过很多次,同样的问题:(

i have tried many times, with the same problem:(

推荐答案

git-svn 基本上不支持标签作为 Git 标签.为了将 SVN 标签转换为 Git 标签,您可以使用:

Basically git-svn doesn't support tags as Git tags. In order to convert SVN tags to Git tags you may use:

  • SubGit (+也许 svnsync 如果您无权访问带有 SVN 存储库的服务器)
  • git-svn + 参考更新命令:"git update-ref refs/标签/TAGNAME refs/remotes/tags/TAGNAME"
  • SmartGit,如果你想要一些 UI 而不是编写脚本
  • SubGit (+maybe svnsync if you have no access to the server with SVN repository)
  • git-svn + command for references update: "git update-ref refs/tags/TAGNAME refs/remotes/tags/TAGNAME"
  • SmartGit, if you want some UI and not writing a script

但请注意:只有第一种和第三种解决方案允许您将标签推送到服务器以与 SVN 标签相关联.使用 git-svn 你应该使用额外的git svn branch"命令.

But note: only the 1st and the 3rd solutions allow you to push tags to the server to be conerted to SVN tags. With git-svn you should use additional "git svn branch" command.

这篇关于git svn 中断,然后我丢失了所有标签,如何修复它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆