使GIT使用凭证存储在GitHub客户端中(或直接存储在GIT中)
为了启用 github 存储库上的推送,我应该使用“令牌身份验证”。
创建令牌后,我应该将其存储在本地 github 客户端中。 https: //docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git。
如何让我的本地 github 客户端与本地 git 交互?我只想使用 git push 到我的 github 存储库并使用存储的令牌进行身份验证。
或者,我会省略本地 github 客户端并将令牌直接存储在 git 中,但我不知道如何实现这一点。
In order to enable pushing on a github repo, I am supposed to use "Token Authentication".
After creating a token, I am supposed to store this in my local github client. https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git.
How do I make my local github client then interact with my local git? I simply want to use git push
to my github repo and use the stored token to authenticate.
Alternatively, I would ommit the local github client and store the token directly in git, but I did not find out how to achieve that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Git 没有用于存储凭据的内置存储,而是依赖“凭据管理器”来存储凭据并在需要时反馈它们。
最常见的凭证管理器是 Git Credentials Manager (GCM)(以前称为 gcm-core)。它可以配置为将凭据存储在操作系统安全存储中或将其加密存储在磁盘上。
或者,如果您依赖适用于 Linux 的 Windows 子系统,您也可以将其搭载在 Windows 凭据存储上。
在您的
.gitconfig
添加:更多详细信息:
Git doesn't have a builtin store for storing credentials, it instead relies on 'credential managers' to store the credentials and feed them back when needed.
The most common credential manager is the Git Credentials Manager (GCM) (formerly gcm-core). It can be configured to store the credentials in your operating systems secure store or to store them encrypted on disk.
Or if you rely on Windows Subsystem for Linux you can have it piggyback on the Windows credential store as well.
In your
.gitconfig
add:More details: