Gre*_*reg 8 c# git powershell command-line chocolatey
更新:
该实用程序是通过我正在经历的经过认证的Microsoft Visual Academy(MVA)视频来帮助配置Git.
当我通过Chocolatey安装软件包时,我收到一个特殊的错误.
cinst poshgit它下载并显示为好像它正在工作,它甚至创建了目录C:\Tools\Poshgit.然后它给了我以下内容:
[错误]无法将参数绑定到参数'Path',因为它是一个空字符串.在C:\ Chocolatey\ChocolateyInstall\Helpers\functions\Writer-ChocolateyFailure.ps1:30 char 2
这导致了失败,我不完全确定为什么.这是一个全新的Chocolatey安装.难道我做错了什么?
因此,安装Git和Posh-Git并不是一件令人愉快的事情,我修复错误的方法是重新安装Chocolatey,然后执行以下操作:
@Powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
Run Code Online (Sandbox Code Playgroud)
我知道这是一个乏味的命令,但我重新安装了上述命令,然后通过Power Shell(以管理员身份运行)执行了以下操作。
Set-ExecutionPolicy RemoteSigned
cinst poshgit
Run Code Online (Sandbox Code Playgroud)
这并没有完全解决,因为有上次失败的痕迹,所以我这样做了:
cinst poshgit -force
cinst git.install -force
git
Run Code Online (Sandbox Code Playgroud)
一旦我输入,git我就可以访问命令git并且能够:
git config --global user.name "Your Name"
git config --global user.email "Your Email"
cinst git-credential-winstore
Run Code Online (Sandbox Code Playgroud)
如果没有任何其他问题,源自命令行安装的问题应该只是从Power Shell开始。
| 归档时间: |
|
| 查看次数: |
896 次 |
| 最近记录: |