Git login error, git clone cannot remember username and password, modify git submit username

Table of contents

git login error

git can't remember username and password

Modify the git commit username


git login error

The error is as follows:

This kind of problem may be because the computer you are using has been used by someone else before, and the user information of git is still the account password of the previous login person, so you cannot successfully pull the code, then you need to log out of other people's account first. Username and password, as follows, enter:

git config --system --unset credential.helper

Now you can clone again, just log in with your username and password.

git can't remember username and password

Then, there is another problem, that is, you need to log in again with your username and password every time you do a git pull. An error was reported. At this time, you need to log out of the last password, enter the code snippet mentioned in the first question, and pull it again. If you don’t want to be so troublesome every time, you can enter the following command:

git config --global credential.helper store

After the execution is completed, a line of code helper = store will be added to the .gitconfig file under the C:\Users\lss path

This is when you execute git push/pull, you will not be asked to enter your password.

Modify the git commit username

You submit the code to gitlab, but the user name displayed in the submission record is not your name. This is usually because you have changed your computer, or for other reasons. At this time, you need to modify your git submission user name:

1. Open the project file directory, right-click Git Bash Here, and open the command line window

2. Enter git config user.name to view the current user name

3. Enter git config --global user.name "modified name" to modify your git submission username

4. Enter git config user.name again to view the modified username

Guess you like

Origin blog.csdn.net/lwx931449660/article/details/118913222