본문 바로가기

카테고리 없음

갑자기 git 명령이 timeout 날 때

오늘 갑자기 git fetch, git pull, git push 등 명령어를 실행할 때, timeout 이 발생하는 현상이 생겼다.

주말동안 특별히 git 과 관련하여 변경한 건 아무것도 없는데 왜 이러지?

그러다 다음의 포스트를 보게 됐고

bengsfort.github.io/articles/fixing-git-push-pull-timeout/

 

Developmental Pixels

Words and thoughts about app development, indie game development, and pixel art.

bengsfort.github.io

다음의 SO 도 보게 됐다.

stackoverflow.com/a/52817036/7548600

 

ssh: connect to host github.com port 22: Connection timed out

I am under a proxy and I am pushing in to git successfully for quite a while. Now I am not able to push into git all of a sudden. I have set the RSA key and the proxy and double checked them, with no

stackoverflow.com

 

~/.ssh/config 파일을 생성하고(이미 존재하면 내용만 append)  다음의 내용을 입력하는 것으로 해결됐다.

Host github.com
    Hostname ssh.github.com
    Port 443

그런 다음, `ssh -T git@github.com` 으로 ssh 접속이 잘 되는지 확인해보고, 잘 된다면 git fetch 등의 명령어가 다시 정상적으로 잘 되는 것을 확인할 수 있다.

github 이 원래의 https 포트인 443 번 포트로 ssh 소켓(원래는 22번)을 열어놓은 것을 사용하도록 설정한 것이다.

 

근데 갑자기 왜 안 되게 된 건지 그 이유는 뭘까? Proxy 를 쓰고 있는 것도 아닌데. 방화벽과 관련된 뭔가가 있는건가?

일단 일 하는 중이어서 원인은 이따가 찾아보기로...

반응형