Github Error : Authentication failed for ~ use a personal access token instead 해결방법

Seong Ho Kim·2023년 10월 12일
0

Git & Github

목록 보기
3/5
post-thumbnail

Github Error : Authentication failed for ~ use a personal access token instead

1) Github Token Error 발생시 조치 방법

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/rlatjdgh9612/git_practice.git/'
  • 터미널을 이용해서 파일(또는 프로젝트)을 push 하다가 git에 연동한 프로젝트나 파일/문서를 push 하려할때 다음과 같은 Error가 발생함.

  • 해당 에러가 일어난 이유)
    -> Github의 ID/Password 방식이 아닌 Developer Token을 이용하여 접근을 시도했기 때문이다.

  • 해결 방법)
    사진에 순서별로 설명을 상세하게 작성해두었습니다. 😊






🚨 Token 사용시 주의사항

  • Generate token 버튼을 누르면 token이 생성되는데 token은 한번만 생성되므로 복사후에 별도로 메모 App에 저장해두는것을 추천한다!

1️⃣ Terminal(로컬)에 Github 계정과 연동하여 push 하는 방법

  • 예시)
mac@seonghoui-MacBookPro git_practice % git remote -v
mac@seonghoui-MacBookPro git_practice % git remote add origin https://github.com/rlatjdgh9612/git_practice.git
mac@seonghoui-MacBookPro git_practice % git remote -v
origin	https://github.com/rlatjdgh9612/git_practice.git (fetch)
origin	https://github.com/rlatjdgh9612/git_practice.git (push)
mac@seonghoui-MacBookPro git_practice % git push origin main

2️⃣ Terminal(로컬)에 Git을 등록하는 방법 - (Github 계정과 연동됨)

  • 예시)
Username for 'https://github.com': '아이디 계정'
Password for 'https://rlatjdgh9612@github.com': '복사한 토큰(token)'

3️⃣ Git 등록 및 push 이후 결과 값

  • 예시)
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (9/9), 987 bytes | 987.00 KiB/s, done.
Total 9 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), done.
To https://github.com/rlatjdgh9612/git_practice.git
 * [new branch]      main -> main
  • 터미널에 이런 결과 코드가 나오면 프로젝트(문서/파일)가 성공적으로 Github main 브랜치에 push 됐음을 알 수 있다.
profile
안녕하세요 Junior UIUX Designer 입니다 😊

0개의 댓글