[Git] git push ssh: connect to host github.com port 22: Connection timed out 에러

2023. 9. 18. 17:23·🛠 DevOps & Tool/Git

 

에러

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

git push하는데 이런 오류가 발생했다..

회사에서 예제 커밋하는거라 방화벽에서 막았나? 생각했는데, 

다른 repo는 push가 잘됐다..;

 

해결 실패

검색해서 아래 2가지 방법을 따라해봤는데 안됐다.

1. 

$ vim ~/.ssh/config

아래 내용을 추가
Host github.com
Hostname ssh.github.com
Port 443

2.

// 1. remote 주소 삭제
$ git remote remove [원격 저장소명]

// 2. remote 주소 추가
$ git remote add [원격 저장소명] [url주소]

// 3. remote 주소 확인
$ git remote -v

 

해결

1) 현재 git remote 연결 주소 확인

$ git remote -v

이렇게 나온다.

origin git@github.com:/git아이디/commitTest.git (fetch)
origin git@github.com:/git아이디/commitTest.git (push)

 

2. git remote url 변경하기 

$ git remote set-url origin https://github.com/내git아이디/commitTest.git

 

3. git push

$ git push origin master

잘되는 것을 확인할 수 있다.

Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 16 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 1.08 KiB | 1.08 MiB/s, done.
Total 8 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/git아이디/commitTest.git
 * [new branch]      master -> master

 

저작자표시 비영리 (새창열림)

'🛠 DevOps & Tool > Git' 카테고리의 다른 글

[Git] 원격 저장소의 브랜치 가져오기 (remote branch)  (0) 2023.11.13
'🛠 DevOps & Tool/Git' 카테고리의 다른 글
  • [Git] 원격 저장소의 브랜치 가져오기 (remote branch)
현주먹
현주먹
대구 불주먹 출신 현주먹의 개발.log
  • 현주먹
    현주먹의 개발로그
    현주먹
  • 전체
    오늘
    어제
    • 전체글 (180)
      • 👶🏻 CS (15)
        • Operating System (7)
        • DB (5)
        • Data Structure (2)
        • Software Engineering (1)
      • 💻 Dev (77)
        • Java & OOP (35)
        • Spring (4)
        • DB&JPA (6)
        • System Design (12)
        • Test Code (1)
        • JSP & Servlet (13)
        • Etc (6)
      • 💡 Algorithm (25)
        • 인프런 (9)
        • 백준 (16)
      • 🛠 DevOps & Tool (11)
        • Linux (4)
        • AWS (1)
        • Git (2)
        • Etc (4)
      • 📝 끄적끄적 (52)
        • 후기 및 회고 (11)
        • TDD, 클린 코드 with Java 17기 (3)
        • F-Lab (23)
        • 📖 Clean Code (3)
        • 항해99 코테 스터디 (11)
  • 블로그 메뉴

    • 🐈‍⬛ GitHub
    • TIL repository
  • 인기 글

  • 최근 글

  • 최근 댓글

  • 태그

    데브클럽
    F-Lab 블로그 챌린지
    개구리책
    오블완
    백준
    C
    개발자취업
    TDD 클린 코드 with Java
    NextSTEP
    JPA
    자바의정석
    티스토리챌린지
    til
    객체지향
    에프랩
    jsp 2.3 웹 프로그래밍: 기초부터 중급까지
    99클럽
    ==와 equals()
    2025스프링캠프
    코딩테스트준비
    jsp
    로또 미션
    F-Lab
    에프랩 후기
    오라클
    f-lab 후기
    항해99
    자바의신절판
    코테스터디
    개발자멘토링
  • hELLO· Designed By정상우.v4.10.2
현주먹
[Git] git push ssh: connect to host github.com port 22: Connection timed out 에러
상단으로

티스토리툴바