잡동사니/GPT가 알려주는
[GPT가 알려주는] fatal: detected dubious ownership in repository at '${git 주소}'
heylo
2025. 4. 4. 15:25
$ git remote add origin 'git 주소'
[에러로그]
fatal: detected dubious ownership in repository at '${git 주소}'
'${git 주소}' is owned by:
(inconvertible) (S-1-5-21-769031098-75115159-906186013-1002)
but the current user is:
DESKTOP-93KNRM7/User (S-1-5-21-325719572-2624369092-316759362-1003)
To add an exception for this directory, call:
git config --global --add safe.directory '%(prefix)///${git 주소}'
이 오류 메시지는 Git이 보안상의 이유로
"이 디렉토리를 내가 믿어도 될까?" 하고 의심하고 있는 거야.
현재 로그인된 사용자와 이 Git 디렉토리의 소유자가 다르기 때문에
"dubious ownership" (의심스러운 소유권) 경고가 발생한 거야.
메시지에 나와 있는 대로
Git에 해당 디렉토리를 "신뢰해도 된다"고 알려주면 돼.
git config --global --add safe.directory '${git 주소}'
🔸 이 명령은 Git이 해당 네트워크 경로의 저장소를 "safe directory"로 간주하게 해서 오류를 없애줘.
이제 다시 아래 명령어를 실행하면 돼.
$ git remote add origin 'git 주소'