且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Git Gui Windows - 如何保存用户凭据 - 用户名和密码

更新时间:2023-01-02 10:32:29

一个解决方案是使用 GitHub for Windows 应用程序:它将为您存储您的凭据,如在此 GitHub帮助页面中提到。



但它也增加了:b
$ b


如果你不想使用GitHub for Windows,你可以在这里下载适用于你的操作系统的助手: / p>

Windows Vista,7,& 8 (需要.NET 4.0)



解压缩文件并运行 git-credential-winstore.exe $ c $程序里面。这将启动帮助程序并更新您的git配置以使用它。

提示:凭证助手仅在克隆HTTPS存储库URL时起作用。如果您使用SSH存储库URL,则使用SSH密钥进行身份验证。


所以你不需要创建一个 .git-credentials 文件: git-credential-winstore.exe 程序将指导您完成它。


I know this question has been asked before and I've been looking at this link :

https://www.kernel.org/pub/software/scm/git/docs/git-credential-store.html

I'm really really new to using Git Gui Application for Windows and Git Hub in general.

I've "fetched" an existing repository by typing in the URL for the repository from the Git Hub website in the format https://github.com/projectname.git

To push to it, I copy paste files into my local git directory and then hit f5 in Git Gui and commit/push to the origin.

However each time I want to push something - it asks me for my username and password. The guide says to create a text file named .git-credentials with your username and password in the given format:

https://user:pass@example.com

Question:

How do I link the usage of the .git-credentials file with my Git Gui Application?...Am I using DOS? Or some Git Shell from somewhere?...

Any help would be greatly appreciated...

One solution is to use the GitHub for Windows application: it will store your credentials for you, as mentioned in this GitHub help page.

But it also adds:

If you don't want to use GitHub for Windows, you can download the helper for your OS here:

Windows Vista, 7, & 8 (.NET 4.0 required)

Unzip the file and run the git-credential-winstore.exe program inside. This will start up the helper and update your git config to use it.

Tip: The credential helper only works when you clone an HTTPS repository URL. If you use the SSH repository URL instead, SSH keys are used for authentication.

So you don't need to create yourself a .git-credentials file: the git-credential-winstore.exe program will guide you through it.