使用git的记忆密码机制保存用户名密码

进入家目录(cd ~)

执行 git clone [你的git代码路径] ,发现需要输入密码,ctrl + c 中断

执行 touch .git-credentials 创建 .git-credentials 文件

执行 vim .git-credentials 编辑该文件

按 i 键进入编辑模式,输入:http(s)://{你的用户名}:{你的密码}@你的git服务器地址 【注意选择 https/http,去掉花括号】

按 ESC 输入 :wq 保存并退出

执行 git config --global credential.helper store

cat ~/.gitconfig 发现多了一项:

[credential]

helper = store

说明已经配置好了,再次 git clone [你的git代码路径] 试试,不需要输入密码了