1.建立文件,保存用户和密码 vi ~/.git-credentials 2在文件里输入如下内容,即git账号和密码 https://用户名:密码@3github.com 3.git config --global credential.helper store