进入git bash:
-
打开命令行默认根目录: touch .git-credentials 创建文件。
-
vi.git-credentials。
-
输入https://username:password@code.xxx.com,保存退出。
https://liangguohun:登入密码@https:xxx仓地址库
-
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"
复制代码