1、在用户setting中生成自己的token,建议全选,有效期无限,复制生成的token
2、清空本地密码
git config --local credential.helper ""
3、设置token
修改服务的配置,配置文件在 .git/config
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = https://用户名:生成的token@github.com/username/**.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "main"] remote = origin merge = refs/heads/main
本文指导如何在GitHub上生成并使用个人访问令牌,包括清除本地密码、配置git以使用token,并展示了如何在.git/config文件中进行相关设置,确保安全地访问和管理远程仓库。

7654

被折叠的 条评论
为什么被折叠?



