SSH를 사용하여 GitHub 프로젝트를 복제하는 방법

신들은 침묵합니다-개인 CSDN 블로그 디렉토리

사용 시나리오: 알 수 없는 네트워크 문제로 인해 GitHub 프로젝트를 HTTPS로 복제할 수 없습니다.

오류 신고fatal: unable to access 'https://github.com/PolarisRisingWar/llm-throught-ages.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.

해결책: 대신 SSH 복제를 사용하십시오.

1단계:
로컬에서 공개 키 만들기

참조: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/geneating-a-new-ssh-key-and-adding-it-to-the-ssh-agent ? 플랫폼=리눅스

Linux 시스템에서는 다음 명령을 실행합니다.ssh-keygen -t ed25519 -C "[email protected]"

공개 키가 저장된 .ssh/id_ed25519.pub공개 키를 가져옵니다. (기본값은 )

2단계:
GitHub 설정에 SSH 키 추가: https://github.com/settings/keys

이름을 지정하고 공개 키를 입력하기만 하면 됩니다.

3단계:
SSH를 사용하여 GitHub 프로젝트 복제

GitHub 프로젝트의 SSH URL을 복사합니다.
여기에 이미지 설명을 삽입하세요.

git clone ssh_url그냥 로컬에서 실행해보세요

추천

출처blog.csdn.net/PolarisRisingWar/article/details/132713802