大厨 git 询问用户名

Chef git asks for username

我正在使用 chef,无论我多么努力地尝试,无论获得正确的 ssh 文件,git 仍然要求我提供用户名。

如何设置它以使其始终具有我的用户名?

git data_bag_item("users", "deployer")["home"] do 
  repository "https://github.com/vvvv/vvvvvvvvvvv"
  user data_bag_item("users", "deployer")["username"]
  ssh_wrapper "ssh -i #{data_bag_item('users', 'deployer')['home']}/.ssh/git_user_rsa" #the path to our private key file
  timeout 10
end

ssh_wrapper 需要是脚本的路径,而不是那样的命令。您可以使用模板资源写出该脚本,也可以跳过 $GIT_SSH 位并使用所需的配置选项将 .ssh/config 文件写出给正确的用户。还请记住,您可能希望在非交互式情况下禁用主机密钥检查。

您正在使用 https URL 和 ssh_wrapper,这没有什么意义。