今天在windows上安装SpaceVim时,提示须要安装Git和curl,安装了Git,本来觉得要经过mingw或者cygwin来安装curl,最后发现原来Git已经自带curl命令,咱们只须要将其配置一下便可在windows命令行使用。git
安装除了一步须要注意的其它都点下一步便可,须要注意的是PATH环境选择界面,选择“Run Git from the Windows Command Prompt”vim
Git的环境变量会自动添加,若是发现环境变量PATH中没有,须要手动添加windows
打开cmd命令提示符,运行命令(git --version)检查git 版本号,若是正确显示版本号说明安装正常bash
在Git的安装目录下有个“mingw64”或者“mingw”文件夹,其实里面已经带有curl命令,但他只能在git-bash中运行,为了能在windows命令行也能调用该命令,能够在Git安装目录的cmd文件夹中新建一个curl.cmd文件,而后将如下内容复制进去便可curl
@rem Do not use "echo off" to not affect any child calls. @setlocal @rem Get the abolute path to the parent directory, which is assumed to be the @rem Git installation root. @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\mingw64\bin;%PATH% @rem !!!!!!! For 64bit msysgit, replace 'mingw' above with 'mingw64' !!!!!!! @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE% @curl.exe %*
打开cmd 命令提示符,运行命令(curl –-version)检查curl版本号编辑器
其实不单单curl命令能够这样,Git还自带了不少命令,也能够经过这种方式配置url