简体   繁体   English

使用Git Bash在Windows上存储GitHub凭据

[英]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.

相关问题 Git SCM / Bash在Windows上不提示输入凭据 - Git SCM/Bash not prompting for Credentials on Windows 在没有bash的情况下将git连接到Windows 7上的github - Connecting git to github on windows 7 without bash 从git的CLI中清除Windows的bash的所有git凭据 - clear all git credentials from the CLI on git for windows' bash 重置 git 凭据(Github) - Reset git credentials (Github) 如何在 Windows 的 Git Credential Manager 中的每个 repo 本地存储凭据? - How to store credentials locally per repo in Git Credential Manager for Windows? Windows 上的 Git Bash - 在哪里存储以及如何调用 Bash 脚本 - Git Bash on Windows - Where to Store and How to Invoke Bash Scripts 如何在不删除管理 windows 凭据管理器中的凭据的情况下使用 git 切换 github 帐户? - How to switch github account using git without deleting credentials in manage windows credentials manager? 使 git 使用存储在 github 客户端中的凭据(或直接将令牌存储在 git 中) - Make git use credentials stored in github client (or store token directly in git) Git Bash和适用于Windows Shell的GitHub有什么区别? - What is the difference between Git Bash and the GitHub for Windows shell? 如何在 Git Bash 中为 ZAEA23489CE3AA9B6406EBB28E0CDA 切换 github 用户? - How can I switch github user in Git Bash for Windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM