1、在终端(terminal)打开你的工程目录
2、输入
git config credential.helper store
3、拉取代码
git pull
4、会提示一次输入用户名密码,下次push代码时就不会再提示password required。
Tips:
设置credential helper
凭据可以设置为全局,也可以设置为仅仅在当前的项目下起作用。
如果想使用全局,则设置为:
git config –global credential.helper store –file=git_credentails.
如果仅仅设置当前项目有效,则进入项目代码目录下,运行:
git config credential.helper store –file=.git_credentails.
上面的–file=.git-credentials表示你的用户名密码存储的文件目录结构,即存放在哪里由你指定。