Windows의 Git 클론 : [email protected]은 git 명령이 아닙니다.

Nov 29 2020

github 및 다른 양식 gitlab에서 ssh 방식으로 저장소를 복제하려고합니다.

나는 Windows 편집에 있습니다 : Git v 2.29.2.2 사용

나는 그것이 무엇에서 오는지 이해할 수없는 다음과 같은 오류가 발생합니다.

$ git clone [email protected]:math-gallou/AI21_TPs.git
Cloning into 'AI21_TPs'...
git: '[email protected]' is not a git command. See 'git --help'.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

그래서 나는 또한 시도했다.

$ git clone "ssh://[email protected]:math-gallou/AI21_TPs.git"

$ git clone ssh://[email protected]:math-gallou/AI21_TPs.git

그러나 똑같은 오류가 나옵니다.

내가 할 때 나는 ssh -v [email protected]성공과 연결할 수 있습니다.

그래서 내가 무엇을 놓쳤습니까?

답변

1 VonC Nov 29 2020 at 21:31

먼저 ssh : // 구문을 시도하는 경우 URL은 다음과 같습니다.

git clone ssh://[email protected]/math-gallou/AI21_TPs.git
                            ^^^ /, not :

둘째, 호스트 항목 이 포함 된 %USERPROFILE%\.ssh\config파일 이 있는지 확인 github.com하십시오. 그 내용은 잘못되었거나 잘못 해석 될 수 있습니다.

An07 Dec 21 2020 at 08:48

제 경우에는 내가 설치 한 openssh를 사용하기 위해 시스템 환경 변수 GIT_SSH를 정의한 다음 git이 손상되고 git: '[email protected]' is not a git command. See 'git --help'..

시스템 환경 변수 GIT_SSH를 삭제하면 모든 것이 다시 작동합니다.

그런 다음 사용자 환경 변수 GIT_SSH 를 정의 하고 시스템을 다시 시작하려고 시도했습니다 (이전 시도에서 시스템을 다시 시작하지 않았습니다). 어쨌든 이제 내 자식은 내가 설치 한 openssh와 올바르게 작동합니다. 이전 시도에서 어떤 부분이 잘못되었는지는 모르지만 더 많은 시간을 낭비하지 않기로 결정했습니다.