项目场景:
每次git拉取代码都需要输入用户名和密码,非常麻烦,怎么解决?
D:\master\ui-console (release/V3.4.4-20221130 -> origin)
λ git pull
Username for 'http://gitlab.rd.cloud.com': xiaoliang
Password for 'http://[email protected]':
Already up to date.
解决方案:
- 先输入以下命令行
git config --global credential.helper store
- 再
git pull
一下,输入一次正确的用户名和密码,便ok
git pull
完整部分:
D:\master\ui-console (release/V3.4.4-20221130 -> origin)
λ git pull
Username for 'http://gitlab.rd.cloud.com': xiaoliang
Password for 'http://[email protected]':
Already up to date.
D:\master\ui-console (release/V3.4.4-20221130 -> origin)
λ git config --global credential.helper store
D:\master\ui-console (release/V3.4.4-20221130 -> origin)
λ git pull
Already up to date.
注意:输入密码时为了保护用户信息是不展示的,不是没有输入,只是没有展示出来。