2

I am using 64-bit Windows 7 with git 1.8.3.msysgit.0 installed.

The command git works fine, from wherever:

PS C:\dev> git --version
git version 1.8.3.msysgit.0

However, the command git-svn does not:

PS C:\dev> git-svn
The term 'git-svn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:8
+ git-svn <<<<
    + CategoryInfo          : ObjectNotFound: (git-svn:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

The example given above is using PowerShell, but running Git bash gives a similar error:

$ git-svn
sh.exe": git-svn: command not found

Git is installed at C:\Program Files (x86)\Git

My Windows Path system variable contains C:\Program Files (x86)\Git\cmd;

It appears that git-svn lives at C:\Program Files (x86)\Git\libexec\git-core\git-svn with no file extension, which is confusing to me since other files in that directory carry .exe extensions, although those are generally larger files, suggesting that perhaps git-svn is supposed to be an alias of sorts for another command, but Windows does not know that it can be executed. I'm just guessing there.

Anyway, how do I fix this?

4

1 回答 1

7

将其执行为git svn(带空格,而不是连字符)。

不久前,git 从所有git-foo可执行文件都在路径上切换PATHgit路径上。我认为核心git可执行文件知道获取它的第一个参数并构造相关git-foo命令,并在目录中查找具有该名称的可执行文件libexec

于 2013-07-19T16:45:53.147 回答