I encountered this problem before, so I just changed the remote address of the HTTPS protocol to SSH (git@github.com:name/code.git).
The SSH method and HTTPS method of the repository are different. On the surface, the URL information is different, but the actual authentication mechanism is also different. After the local key is established, there is actually no need to authenticate again when using ssh, while https requires entering a password each time.
The password you need to enter should be the security policy implemented by github. The user name and password you enter are github’s username and password
You can modify it with the following command to change the HTTPS branch to the SSH branch. The effect is the same as modifying the .git/config file git remote rm origingit remote rm origin git remote add origin git@github.com:twlkyao/demo.git git push origingit remote add origin git@github.com:twlkyao /demo.git
I also encountered this problem yesterday. I had to enter a password every time I submitted. Later, when I used ssh to clone, I couldn't enter the password. . .
Edit the .git/config file in the project directory
Found:
Change the url to the ssh address:
When the url is https, username authentication will be used. When it is an ssh address, ssh authentication will be used
I encountered this problem before, so I just changed the remote address of the HTTPS protocol to SSH (git@github.com:name/code.git).
The SSH method and HTTPS method of the repository are different. On the surface, the URL information is different, but the actual authentication mechanism is also different. After the local key is established, there is actually no need to authenticate again when using ssh, while https requires entering a password each time.
The password you need to enter should be the security policy implemented by github. The user name and password you enter are github’s username and password
You can modify it with the following command to change the HTTPS branch to the SSH branch. The effect is the same as modifying the .git/config file
git remote rm origin
git remote rm origin
git remote add origin git@github.com:twlkyao/demo.git
git push origin
git remote add origin git@github.com:twlkyao /demo.git
git push origin
🎜I also encountered this problem yesterday. I had to enter a password every time I submitted. Later, when I used ssh to clone, I couldn't enter the password. . .