我为 Windows 和 Powershell 7.1 安装了 Git。当我尝试使用 ssh 密钥从 git bash 克隆存储库时,它运行良好。但是,当我尝试从 Powershell 7.1 执行类似操作时,我遇到了致命错误:无法从远程存储库中读取错误。
遵循的步骤
1. PS> Start-Service ssh-agent
2. PS> ssh-add D:\Keys\.ssh\my_private_key (I get identity added message)
3. PS> git clone git@github.com:my-username/my-repo.git
错误信息
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights