git svn show-ignore给出错误“command returned error:1” [英] git svn show-ignore gives error "command returned error: 1"

查看:358
本文介绍了git svn show-ignore给出错误“command returned error:1”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将一个项目从SVN迁移到git。这是我使用的命令:

  $ git svn克隆http:// oursvnserver / --no-metadata -A .. /authors-transform.txt --trunk = path / to / trunk --branches = path / to / branches --tags = path / to / tags。 --username = mysvnusername --prefix = origin / 

当前目录是我想要的目录成为一个存储库。 authors-transform.txt 绝对是在正确的位置。该项目使用标准布局,但不存在于存储库的根目录。 (不幸的是,很久以前有人开始将所有项目填充到同一个存储库中,这就是为什么我指定 - trunk - branches - tags 。)它似乎很好。然后我尝试生成一个忽略文件,并得到这个令人难以置信的神秘错误:
$ b $ $ p $ code $ git svn show-ignore
config --get svn-remote.svn.fetch:refs / remotes / git-svn $:command returned error:1



$ p
$ b $ $ $ $ $ $ $ $ g $ git config - -get svn-remote.svn.fetch:refs / remotes / git-svn || echo $?
1
$ git config --get svn-remote.svn.fetch:refs / remotes / git-svn $ || echo $?
1

所以也许我正在猜测它调用的是什么命令?但这并没有什么帮助。



这个错误究竟意味着什么?我可以尝试解决它吗?



使用msysgit 1.9.4。

解决方案

所以这是由于git无法在 svn-remote 中找到匹配的 fetch 部分 $ GIT_DIR / config 文件。没有 git svn show-ignore 的参数,它不知道该部分要查找什么。 (也许我的跟踪设置不正确?)



要处理这个问题,您需要先指定您希望查看的远程设备:

  git svn show-ignore --id = origin / trunk 

(请注意,我在执行克隆时指定了origin前缀)相应地改变您的命令。)

其次,仍然失败,为我的分支非常类似的错误。它适用于树干,但不是分支。这是因为分支机构没有 fetch 条目。要添加它们,请使用以下命令(对前缀进行调整):

  git config --add svn-remote.svn.fetch path / to / branches / branchname:refs / remotes / origin / branchname 

要查看所有 fetch 条目并确保它有效:

  git config --get-all svn-remote.svn.fetch 

我不确定为什么只有一个中继入口被设置为开始;也许我在克隆上做了一些错误。


I'm trying to migrate a project from SVN to git. This is the command I use:

$ git svn clone http://oursvnserver/ --no-metadata -A ../authors-transform.txt --trunk=path/to/trunk --branches=path/to/branches --tags=path/to/tags . --username=mysvnusername --prefix=origin/

The current directory is the directory that I want to become a repository. authors-transform.txt is most definitely in the right location. The project uses the standard layout, but it does not exist at the root of the repository. (Unfortunately, someone long ago started the practice of just stuffing all projects into the same repository. That's why I specify --trunk, --branches, and --tags.) It seems to check out fine. Then I try to generate an ignore file and get this incredibly cryptic error:

$ git svn show-ignore
config --get svn-remote.svn.fetch :refs/remotes/git-svn$: command returned error: 1

It appears to be running some other command in the process, so I made some guesses:

$ git config --get svn-remote.svn.fetch :refs/remotes/git-svn || echo $?
1
$ git config --get svn-remote.svn.fetch :refs/remotes/git-svn$ || echo $?
1

So maybe I'm guessing right about what command it's calling? But that doesn't really help.

What does this error actually mean? What can I try to resolve it?

Using msysgit 1.9.4.

解决方案

So this is caused by git not being able to find a matching fetch entry in the svn-remote section of the $GIT_DIR/config file. Without an argument to git svn show-ignore, it doesn't know what to look for in that section. (Maybe my tracking isn't set up right?)

To deal with this, you need to first specify which remote you want it to look at:

git svn show-ignore --id=origin/trunk

(Note that I specified the "origin" prefix when performing the clone. Vary your command accordingly.)

Secondly, this still failed with a very similar error for my branches. It worked fine for trunk, but not branches. This is because there was no fetch entry for the branches. To add them, use this command (with adjustments for prefix):

git config --add svn-remote.svn.fetch path/to/branches/branchname:refs/remotes/origin/branchname

To see all the fetch entries and make sure it worked:

git config --get-all svn-remote.svn.fetch

I'm not sure why only an entry for trunk is set in the beginning; maybe I did something wrong with the clone.

这篇关于git svn show-ignore给出错误“command returned error:1”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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