我正在使用安装了git 1.8.3.msysgit.0的64位Windows 7.
该命令git工作正常,从以下任何地方:
PS C:\dev> git --version
git version 1.8.3.msysgit.0
Run Code Online (Sandbox Code Playgroud)
但是,该命令git-svn不会:
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
Run Code Online (Sandbox Code Playgroud)
上面给出的示例是使用PowerShell,但运行Git bash会产生类似的错误:
$ git-svn
sh.exe": git-svn: command not found
Run Code Online (Sandbox Code Playgroud)
Git安装在 C:\Program Files (x86)\Git
我的Windows Path系统变量包含 C:\Program Files (x86)\Git\cmd;
看来,git-svn住在C:\Program Files (x86)\Git\libexec\git-core\git-svn没有文件扩展名,这是令人困惑我,因为在该目录中携带的其他文件.exe扩展名,但这些都是一般较大的文件,这也许git-svn应该是各种各样的另一个命令的别名,但Windows不知道它可以执行.我只是猜测那里.
无论如何,我该如何解决这个问题?
执行它git svn(带空格,而不是连字符).
不久之后,git从拥有所有git-foo可执行文件切换PATH到只是git在路径上.我认为核心git可执行文件知道获取它的第一个参数并构造相关git-foo命令,并在libexec目录中查找该名称的可执行文件.