remote: Permission to 오류 해결 과정
새로운 프로젝트를 위해 새로운 Gmail 아이디 및 git 아이디를 만들어 git을 push하는 과정에서 오류가 생겼다.
블로그를 보고 해봤지만 안 되길래 다른 방법 강구해봄!
(mac의 경우는 키체인에 입력된 기존 git 이름을 수정하는 방식이었음)
remote: Permission to jeonga96/admin.git denied to 199jeonga.
fatal: unable to access 'https://github.com/jeonga96/admin.git/': The requested URL returned error: 403
진행하다 키체인 수정이 아닌 삭제를 했더니 아래와 같은 오류 메세지를 확인!
나는 기존 아이디가 아닌 새로운 아이디를 생성했기 때문에 새로운 아이디는 깃 허브의 토큰이 아직 없었음!
git push를 진행할 때에는 토큰이 있어야 하기 때문에 토큰 생성부터 진행해보려고 함.
Username for 'https://github.com': jeonga96
Password for 'https://jeonga96@github.com':
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/jeonga96/admin.git/'
깃토큰 생성 및 설정 과정
- 깃허브 - Settings 클릭
- Developer settings 클릭
- Personal access tokens 클릭
- Generate new token 클릭
- Token 설정
- 생성된 토큰 복사 및 따로 메모
- Mac KeyChain 삭제 (키체인접근에 들어가 .git으로 검색하여 인터넷 암호를 삭제한다.)
- 터미널에 유저 정보 입력
// 잔디를 심기 위해서는 깃허브 이메일로 입력해야 함 $ git config --global user.name [유저이름] $ git config --global user.email [유저아이디]
- git push 후 유저이름과 비밀번호 입력
끝!Username for https://github.com : [유저이름] Password for https://github.com/[유저이름] : [생성된 토큰 붙여넣기]
하지만 나는 아래와 같은 오류가 확인되었다.
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'https://github.com/jeonga96/admin.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
(basic - git 개발환경구축 게시글에 올렸던 오류로 강제 push 진행!)
git push origin +main
'개발환경 구축' 카테고리의 다른 글
react error - 배포할 때 발생하는 흰 화면 Uncaught SyntaxError: Unexpected token '<' 오류 (0) | 2022.08.08 |
---|---|
readme.md 작성 요령 (0) | 2022.07.25 |
[SSH key]github계정을 여러개 사용할 때 번거롭게 git push하지 않기 위해 SSH 설정 & SSH사용해서 git clone (0) | 2022.07.12 |
git&git hub 레파지토리와 로컬파일 연결 (0) | 2022.06.28 |
react 개발환경 구축하기 & 라이브러리 (0) | 2022.06.28 |