1. Create a file, enter the file, and enter the content:
cd ~
touch .git-credentials
vim .git-credentials
https://{username}:{password}@github.com
2. Enter in the terminal:
git config --global credential.helper store
Open the ~/.gitconfig file and you will find an additional item:
[credential]
helper = store
In fact, directly execute "git config --global credential.helper store", and then call the "git push xxx" operation. After entering the account and password once, git will automatically generate a .git-credentials file, and then transfer this account The password information is saved in a file.
Original link: https://blog.csdn.net/tq384998430/article/details/77770127