【问题标题】:Cloning repository using GIT on Powershell ISE - Proxy issues在 Powershell ISE 上使用 GIT 克隆存储库 - 代理问题
【发布时间】:2018-01-18 10:02:29
【问题描述】:

我在使用带有 Git-Posh 的 PowerShell ISE 时遇到代理错误。

仅使用 GIT (Bash) 时,克隆就可以了。我必须将这些添加到 .gitconfig 文件中

[http]
    proxy = http://localhost:1800

[https]
    proxy = http://localhost:1800

但是,在 PowerShell ISE 脚本上使用 Git-posh 时出现异常:

1) 命令一生成此异常。

$resp = Invoke-WebRequest -Headers $headers -Uri ("{0}/_apis/git/repositories?api-version=1.0" -f $url)
$json = convertFrom-JSON $resp.Content

Invoke-WebRequest:需要代理授权 说明:访问此代理需要授权

2) 克隆会产生这个异常

 git clone --mirror $url

致命:无法访问 'https://pn%fastCars.onmicrosoft.com:3kfokgwgwgwiigjiwjgjwigiiqegqegewrwghdasdasfggaffaa@fastCars.visualstudio.com/Ferrari/_git/FerrariF50-PerformanceTests/': 失败 连接到 localhost 端口 1800:连接被拒绝

有谁知道哪个命令可以扭转这种局面?

【问题讨论】:

标签: git powershell http proxy azure-devops


【解决方案1】:

如果您只想直接使用 powershell 来处理 Git,您可以使用 module to work with VSTS online。为了能够在线向 VSTS 进行身份验证,我必须得到一个Token。获得令牌并对其进行身份验证后,我就可以使用 VSTS 模块中的 cmdlet。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-07
    • 1970-01-01
    • 2017-09-09
    • 2016-08-15
    • 2013-07-14
    • 1970-01-01
    相关资源
    最近更新 更多