我一直在尝试安装git-secrets,这已经过去了几个小时,而且似乎无法弄清楚。 Google搜索让我几乎一无所获,几乎所有结果都是git-secret(单数秘密,而不是复数形式)。
我将the folder克隆到计算机上,并以管理员模式打开WindowsPower Shell,以运行install.ps1
文件。
这是我从PowerShell获得的输出:
Checking to see if installation directory already exists...
Creating installation directory.
Copying files.
Copy-Item : Cannot find path 'C:\windows\system32\git-secrets' because it does not exist.
At C:\Users\ricci\Downloads\git-secrets\install.ps1:15 char:1
+ Copy-Item ./git-secrets -Destination $InstallationDirectory -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\windows\system32\git-secrets:String) [Copy-Item], ItemNotF
oundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
Copy-Item : Cannot find path 'C:\windows\system32\git-secrets.1' because it does not exist.
At C:\Users\ricci\Downloads\git-secrets\install.ps1:16 char:1
+ Copy-Item ./git-secrets.1 -Destination $InstallationDirectory -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\windows\system32\git-secrets.1:String) [Copy-Item], ItemNo
tFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
Checking if directory already exists in Path...
Already in Path.
Adding to user session.
Done.
当我在仓库目录中运行git secrets --register-aws --global
时,它返回git: 'secrets' is not a git command. See 'git --help'
任何想法我需要做什么或可以在哪里寻求帮助?
谢谢
install.ps1
包括:
install.ps1
Param([string]$InstallationDirectory = $($Env:USERPROFILE + "\.git-secrets"))
在您的会话中似乎是$Env:USERPROFILE
,这不好。
尝试打开Powershell会话:
C:\Windows\System32
路径(%USERPROFILE%
)内,而不是C:\Users\xxx