
Клонирование Git с использованием https не работает на моем компьютере Mac, возникает следующая ошибка:
akshaybandivadekar@Akshays-MacBook-Pro codebase % git clone https://github.com/lodash/lodash.git
Cloning into 'lodash'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Но через ssh это работает
git clone [email protected]:lodash/lodash.git
Я ссылался на этот документ для настройки ключа SSH: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-addding-it-to-the-ssh-agent
решение1
Это решило мою проблему
git config --global url."[email protected]:".insteadOf "https://github.com/"