GitBash Credentials 수정

2024. 11. 14. 10:32Git

$ git push -u origin main
remote: Permission to nomadinsunda/inferencelocalhost.git denied to intheeast.
fatal: unable to access 'https://github.com/nomadinsunda/inferencelocalhost.git/': The requested URL returned error: 403

 

이 오류는 현재 intheeast GitHub 계정으로 접근 권한이 없어서 발생하는 것입니다. nomadinsunda 계정으로 변경하려면 다음 단계들을 따라 설정을 변경할 수 있습니다.

 

1. 현재 Git 사용자 정보 확인

먼저, 현재 사용 중인 Git 사용자 정보를 확인하려면 Git Bash에서 다음 명령어를 입력하세요.

   git config --global user.name
   git config --global user.email

 

2. Git 사용자 정보 변경

nomadinsunda 계정으로 GitHub 저장소에 접근하기 위해 사용자 정보를 다음과 같이 설정하세요.

   git config --global user.name "nomadinsunda"
   git config --global user.email "nomadinsunda@example.com"

이 때 nomadinsunda@example.comnomadinsunda 계정에 등록된 이메일로 바꾸셔야 합니다.

 

3. GitHub 인증 자격 변경 (캐시 제거)

HTTPS 인증 자격 증명(Credential)이 Git에 캐시되어 있어 intheeast 계정 정보가 저장되어 있을 수 있습니다. 이를 지우고 nomadinsunda 계정으로 새로 로그인할 수 있도록 설정하려면 다음을 실행하세요.

   git credential-manager-core erase

 

또는 Windows 자격 증명 관리자에서 GitHub 인증 정보를 삭제할 수 있습니다.

 

 

4. Git 저장소 다시 push

위 단계를 완료한 후에도 문제가 발생하면, nomadinsunda 계정으로 새로 인증하여 GitHub 리포지토에 다시 push해보세요. 이제 nomadinsunda 계정으로 Git 작업을 실행할 수 있을 것입니다.

'Git' 카테고리의 다른 글

remote repository를 local host pc에 add하는 방법  (0) 2025.05.08
git log --oneline --decorate --graph --all  (0) 2024.07.25
Refs  (0) 2024.07.24
git diff  (0) 2023.12.12
Tracking branch와 Upstream  (0) 2023.06.30