본문 바로가기

ERROR

[GIT] ERROR: Permission to denied to

git의 새로운 저장소에 코드를 수정하려고 했는데 다음과 같은 오류가 생겼다.

 

 

ERROR: Permission to account/repository.git denied to account2.
fatal: Could not read from remote repository.

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

 

 

gitub 계정이 2개인데 설정을 잘못한 것 같다.

 

 

이런 오류가 뜰 때는

git remote remove origin

먼저 기존의 origin 을 지워주고 (origin : 내가 복제해서 가져온 저장소)

 

내가 넣고자 하는 저장소를 다시 설정해주고

git remote add origin repository주소.git

 

코드를 push를 해주면 된다