git 账号和密码管理

mac2026-04-09  2

文章目录

1. git push github 免输入账号和密码方法2. git 重置用户名 密码信息

1. git push github 免输入账号和密码方法

运行:

git config --global credential.helper store

打开~/.gitconfig文件,会发现多了一项: [credential]   helper = store 此时,再次push 输入用户名和密码,以后再次push即可免去输入用户名和密码

2. git 重置用户名 密码信息

git clone 时 ,权限不够。 如 fatal: unable to access : The requested URL returned error: 403 可能原因是,你之前在本电脑使用过git. 但是以前和现在又不是同一个账户。所以当你现在使用 git clone url 时 ,默认使用以前的账户信息。所以出现没有权限的状况。

解决方法: 重置本机保留的git config 信息。 运行:

git config --system --unset credential.helper

然后你再次克隆的时候,就会让你输入用户名和密码了

最新回复(0)