git svn show-ignore gives error “command returned error: 1”

大兔子大兔子 提交于 2019-12-03 09:44:47

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!