The solution to the problem that you need to enter your username and password every time you pull code using git software such as cmder and xshell

Project scenario:

Every time I pull code from git, I need to enter my username and password, which is very troublesome. How to solve it?

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.

solution:

  1. First enter the following command line
git config --global credential.helper store
  1. Once git pullagain, enter the correct username and password and it will be ok.
git pull

Complete part:

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.

Note: When entering the password, in order to protect the user information, it is not displayed. It is not that the password is not entered, it is just not displayed.

Guess you like

Origin blog.csdn.net/migexiaoliang/article/details/127897801
Recommended