https를 사용하는 Git 복제가 작동하지 않지만 SSH의 도움으로 작동합니다.

https를 사용하는 Git 복제가 작동하지 않지만 SSH의 도움으로 작동합니다.

https를 사용하는 Git 복제가 내 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/geneating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

답변1

내 문제가 해결되었습니다.

git config --global url."[email protected]:".insteadOf "https://github.com/"

관련 정보