git set account name password

Recently, I created a new project to synchronize git code, but every time I connect to the remote, I have to re-enter the username and password information, which is very annoying, so I just think about how to make him remember the account number. I just used the following method, the personal test is effective, share and record.

1. Open the .git folder under the current project, find the config file, and compare the contents of the file:

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = https://gitee.com/wyt1909/house.git
	fetch = +refs/heads/*:refs/remotes/origin/*
//主要是以下三行,是记住密码的设置
[branch "master"]
    remote = origin
    merge = refs/heads/master

2. Execute and enter your git username and password:

git config --global user.email [email]   //邮箱
git config --global user.name [username] //密码

3. Open the command line and enter the .git file, execute the command: git config --list

 

 When the above two lines of email passwords appear, your git has recorded the account password at this time, and you don’t need to re-enter it when uploading and pulling again.

If the above method does not work, you can try the following command:

git config --global credential.helper store 

When you pull or push again, it will pop up that you need to enter the account password. After entering this time, you don’t need to enter it again next time. Many friends have encountered this problem, so I feel that I need to enter it after setting it, but it has no effect.

Guess you like

Origin blog.csdn.net/MrWangisgoodboy/article/details/130572708