Recently, in the process of compiling the company's ios code, when executing pod update, when pulling the code from git, it always reported an error: fatal:could not read Username for 'https://github.com':No such file or directory , the protocol used is the https transport protocol.
According to the prompt, it is judged that the problem is caused by not remembering the git account and password.
First, the global settings of the account are made:
git config --global user.name "xxxx"
git config --global user.email "[email protected]"
Then execute, find that the problem still exists, and then search for the global configuration that remembers the account password:
git config--global credential.helper store
Then execute the build and find that the problem also exists. Later, I found an explanation document on the coding official, and tried it out.
There are two ways:
To push using SSH, you need to configure the SSH public key to operate. For details, please read the SSH public key configuration document
For Https protocol: First save your password in the global configuration, add it in ~/.git-credentials (create it if you don't have it) and
https://{username}:{passwd}@git.coding.net
then execute the configure Git command to store the credential command:$git config--global credential.helper store
After execution, the following configuration items will be added to the ~/.gitconfig file:
credential.helper = store
Hope it helps those who have the same problem! ! ! Of course, you can use ssh directly.