[Git 에러] fatal: Could not read from remote repository.

2024. 2. 21. 12:21기타/Git

목차

    에러 상황

    원격 브랜치에 push 하는 상황에 해당 에러 발생.
    github 원격 브랜치에 연결이 되지 않는 현상

    에러 내용

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

    에러 이미지

     

    해결방법

    1. 원격 브랜치 재설정

    2. ssh 재설정

     

    방법 1. 원격 브랜치 재설정

    1. 원격 저장소 상태 확인

    git remote -v

    원격 저장소 상태

     

    2. 원격 저장소 연결 제거

    git remote remove {원격 저장소 이름(ex origin, master)}

     

    3. 원격 저장소 재 연결

    git remote add {원격 저장소 이름(ex origin, master)} {github 원격저장소 URL}

    github URL 복사

    4. 원격 저장소 상태 재확인

    git remote -v

    원격 저장소 상태


    2. ssh 재설정

    ssh 재설정 방법: https://hunstory.tistory.com/30

    '기타 > Git' 카테고리의 다른 글

    유용한 git action 모음  (2) 2025.04.10
    git 대소문자 구별  (0) 2021.12.21
    [git ERROR] Your account is suspended. Please check with your installation administrator  (0) 2021.11.26
    git index.lock  (0) 2021.11.26