How to avoid entering account and password for each git clone under Linux

       Some warehouses have many submodules. When cloning, each submodule will ask you to enter the account password once, which is very annoying. The solution is as follows:

Under ~/, touch to create the file .git-credentials, edit this file with vim, and enter the content format:

touch .git-credentials
vim .git-credentials

Press "i" inside and enter: https://{username}:{password} @github .com

For example https://aoeddklj:[email protected]

Execute under the terminal:

git config --global credential.helper store

You can see that the ~/.gitconfig file has one more item:

[credential]
    helper = store

At this time, you only need to enter it once when pulling the submodule again.

Guess you like

Origin blog.csdn.net/qq_34761779/article/details/130251362