Mac 切换仓库地址后每次都要重新输入密码

843 阅读1分钟

进入git bash:

  1. 打开命令行默认根目录: touch .git-credentials 创建文件。

  2. vi.git-credentials。

  3. 输入https://username:password@code.xxx.com,保存退出。

    https://liangguohun:登入密码@https:xxx仓地址库

  4. git config --global credential.helper store, 然后cat .gitconfig 会增加一行:helper=store。 全局配置用户名和邮箱:

git config user.name 查询
git config --global user.name "liangguohun"
git config --global user.email "liangguohun@qq.com"