在Windows上安装git-secrets

问题描述 投票:2回答:1

我一直在尝试安装git-secrets,这已经过去了几个小时,而且似乎无法弄清楚。 Google搜索让我几乎一无所获,几乎所有结果都是git-secret(单数秘密,而不是复数形式)。

我将the folder克隆到计算机上,并以管理员模式打开WindowsPower Shell,以运行install.ps1文件。

这是我从PowerShell获得的输出:

https://i.stack.imgur.com/zGFHx.png

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'

任何想法我需要做什么或可以在哪里寻求帮助?

谢谢

security github
1个回答
0
投票

install.ps1包括:

install.ps1

Param([string]$InstallationDirectory = $($Env:USERPROFILE + "\.git-secrets")) 在您的会话中似乎是$Env:USERPROFILE,这不好。

尝试打开Powershell会话:

  • 作为您自己的Windows帐户(不是管理员)
  • 在您的C:\Windows\System32路径(%USERPROFILE%)内,而不是C:\Users\xxx
© www.soinside.com 2019 - 2024. All rights reserved.