我正在使用Windows OS和Github作为存储库。 我想在buildspec文件中使用Git命令添加远程存储库。 我的命令是git remote add origin https://github.com/moodysanalytics/maks-bc-fdeexcelwrapper。 我收到错误消息“术语'git'无法识别为cmdlet的名称”
version: 0.2
phases:
install:
commands:
- git remote add origin <My Repository>
我用巧克力安装了Git。我仍然遇到相同的错误。
version: 0.2
phases:
install:
commands:
- Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- Write-Host $Env:Path
- C:\ProgramData\chocolatey\bin\choco.exe install -y git.install
- Write-Host $Env:Path
- setx PATH "$env:Path;C:\Program Files\Git\bin\"
- setx PATH "$env:Path;$Env:Path + ;C:\Program Files\Git\cmd\"
- Write-Host $Env:Path
- git remote add origin <MyRepo>