[英]Store GitHub credentials on Windows with Git Bash
I am trying to set up a Jenkins Windows slave which will pull from GitHub using Git Bash. 我正在尝试设置一个Jenkins Windows从站,它将使用Git Bash从GitHub中提取。 I have installed Git Bash on my Windows server so it is available through the Windows command prompt. 我已经在Windows服务器上安装了Git Bash,因此可以通过Windows命令提示符使用它。 When I try to invoke any Git command that goes to GitHub it always asks for my credentials. 当我尝试调用转到GitHub的任何Git命令时,它总是要求我提供凭据。
How can I set this up so it does not ask for my credentials? 我该如何设置它以便不要求我提供凭据?
Points to note: 注意事项:
I am testing it by invoking from the Windows cmd and not the Git Bash shell as I believe this is how Jenkins will call it. 我通过从Windows cmd而不是Git Bash shell调用来测试它,因为我相信这就是Jenkins称之为的方式。
If it isn't possible, how do you connect to GitHub from a Jenkins slave via Git Bash without it asking for credentials? 如果不可能,您如何通过Git Bash从Jenkins从属服务器连接到GitHub,而不要求它提供凭据?
I had a browse around and managed to find my answer. 我浏览了一下,设法找到了答案。 It is solved by the following post 通过以下帖子解决
Is there a way to skip password typing when using https:// on GitHub? 在GitHub上使用https://时,是否可以跳过密码输入?
Works a treat!! 工程款待!!
See Git Bash at https://msysgit.github.io 在https://msysgit.github.io上查看Git Bash
It's a Linux-like console for Windows. 这是Windows的类似Linux的控制台。
You will need to generate SSH keys which will be in your HOME_DIR/.ssh
folder. 您将需要生成SSH密钥,该密钥位于您的HOME_DIR/.ssh
文件夹中。
As an example, see Working with Git on Windows . 例如,请参阅在Windows上使用Git 。
After generating keys, install it to the GitHub account. 生成密钥后,将其安装到GitHub帐户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.