Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否自动缓存Windows批处理脚本中的git凭据?_Windows_Git_Caching_Batch File_Git Config - Fatal编程技术网

是否自动缓存Windows批处理脚本中的git凭据?

是否自动缓存Windows批处理脚本中的git凭据?,windows,git,caching,batch-file,git-config,Windows,Git,Caching,Batch File,Git Config,这是我第一个正确的Windows批处理脚本之一;所以,请善待我: set /p GIT_CACHE="Cache git credentials?: " %=% if /i {%GIT_CACHE%}=={y} (goto :cache) if /i {%GIT_CACHE%}=={yes} (goto :cache) if /i {%GIT_CACHE%}=={[yes]} (goto :cache) goto :skip_cache :cache for %%X in (git-creden

这是我第一个正确的Windows批处理脚本之一;所以,请善待我:

set /p GIT_CACHE="Cache git credentials?: " %=%
if /i {%GIT_CACHE%}=={y} (goto :cache)
if /i {%GIT_CACHE%}=={yes} (goto :cache)
if /i {%GIT_CACHE%}=={[yes]} (goto :cache)
goto :skip_cache
:cache
for %%X in (git-credential-winstore.exe) do (set FOUND2=%%~$PATH:X)
if NOT DEFINED FOUND2 (
    curl -o git-credential-winstore.exe "http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=gitcredentialstore&DownloadId=672532&FileTime=130119839935000000&Build=20885"
    gitcreds.exe -s
    curl -O "https://github.com/downloads/anurse/git-credential-winstore/git-credential-winstore.exe" -k
    if exist (C:\Progra~2\Git\libexec) (
        copy git-credential-winstore.exe "C:\Progra~2\Git\libexec\git-core")
    if exist (C:\Progra~1\Git\libexec) (
        copy git-credential-winstore.exe "C:\Progra~1\Git\libexec\git-core"))
git config --global credential.helper winstore
:skip_cache
不幸的是,脚本的下一行(使用
git
)给出了以下错误:

致命:“credential winstore”似乎是git命令,但我们无法执行它。也许git winstore坏了


看起来像是
git
现在在Windows上附带了
wincred
开箱即用(msysgit):

参考

git config --global credential.helper wincred