git svn中断,那么我失去了所有的标签,如何解决呢? [英] git svn interrupted, then i lost all the tags, how to fix it?

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

问题描述

我要使用git svn clone -s svn:// xxx从svn repo(在centos)克隆代码,然后它被中断的奇怪的问题,错误消息如下:



下面的父进程用do_switch
成功跟随父进程
在/ usr / lib / perl5的串联(。)或字符串中使用未初始化的值/vendor_perl/5.8.8/i386-linux-thread-multi/SVN/Core.pm行584.
网络连接意外关闭:在/ usr / libexec / git-core / git-svn line 2693

然后使用

继续此克隆过程。

  time git svn fetch -r HEAD 

并最终成功克隆svn repo:

  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)
自动打包最佳性能的存储库。您也可以
手动运行git gc。有关详细信息,请参阅git help gc。
计数对象:12449,完成。
压缩对象:100%(12177/12177),完成。
编写对象:100%(12449/12449),完成。
总计12449(delta 9475),重用0(delta 0)
签出HEAD:
svn://svn.nginx.org/nginx/trunk r4817

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

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

  [root @ home nginx ]#git branch 
* master
[root @ home nginx]#git tag //没有标签(

[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个标签, local .git repo?



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



i已经尝试过很多次,有相同的问题:(

解决方案

基本上git-svn不支持标签作为Git标签。 order to convert SVN tags to Git tags you may use:




  • SubGit (也许 svnsync 如果您无权访问带有SVN存储库的服务器)

  • git-svn +用于引用更新的命令:
    git update-ref refs / tags / TAGNAME refs / remotes / tags / TAGNAME li>
  • SmartGit ,如果您想要一些UI而不是写作一个脚本



但是请注意:只有第一和第三个解决方案允许您将标签推送到服务器以生成SVN标签。使用git-svn你应该使用额外的git svn branch命令。


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

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

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

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

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

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

解决方案

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

  • 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

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天全站免登陆