Error

[Error- Git] fatal: not a git repository (or any parent up to mount point [Directory])

Y30L 2023. 10. 14. 00:59

1. 에러 내용

Git의 pull 명령어를 사용하여 원격 저장소에 존재하는 프로젝트를 가져오려고 하였으나 [그림 1]과 같이 fatal: not a git repository (or any parent up to mount point [Directory])에러가 발생하였다. 

 

Git에 대한 정보가 담긴 파일이 존재하지 않아 발생한 오류이다.

[그림 1] Error 발생 화면

 

2. 해결방안

Git에 대한 정보가 없으므로 아래와 같이 Git을 초기화하고 새로운 Origin을 추가하면 해결된다.

git init
git remote add origin https://github.com/[Github 계정]/[저장소 주소].git