목차

반응형

상황

git pull 명령어 사용 시 아래 문구가 뜨면서 작동안한다.

Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

과거 몇달전부터 username과 password로 인증하던 나에게 계속 경고하더니

git에서 8월 13일 이후로 아예 token 아니면 안되도록 바꿔버렸다.

 

이미 있는글인데 원하는 해결방법 부분만 깔쌈하게 올리는 사람이 없어서 내가 정리해서 올린다.

linux 기준이니 참고

 

 

해결방법

1. token 발급

 

아래 링크 들어간다. 또는 깃에서 setting > Developer settings > personal access tokens 이동

https://github.com/settings/tokens

 

GitHub: Where the world builds software

GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

github.com

 

generate new token 클릭

 

 

1. 해당 토큰의 닉네임

2. 토큰 만료기간

3. 토큰의 권한

그냥 권한 전부 주고 만료 안되도록 했다. 설정하고 하단 generate token 클릭

 

그럼 토큰이 나오는데 다시 조회 불가능하니 복사해서 잘 관리하라고 한다.

 

2. 발급받은 토큰 프로젝트에 설정

이게 제일 중요한데 잘써놓은 사람이 없어서 이 부분을 잘 작성해보겠다. 한 20분인가 30분 노가다 했다.

 

토큰을 사용하기 위한 상황 중 한 가지 remote를 set 하는 경우다.

양식은 아래와 같다고 한다.

 

git remote set-url origin https://<githubtoken>@github.com/<username>/<repositoryname>.git

 

만약 내 유저네임이 ajhpipe고 토큰이 ghp_13574763TEMb7oe44jy24 이고

git repo의 경로는 https://github.com/ 10moment/tenmoment-front.git이라고 하자

그러면 설정하기 위한 명령어는 다음과 같다.

 

git remote set-url origin https://ghp_13574763TEMb7oe44jy24@github.com/10moment/tenmoment-front.git

저기서 말하는 username은 내가 아니라 프로젝트 생성자의 username이니까 헷갈리지 말고 토큰과 깃 repo 경로 정보만 사용해서 명령어를 작성하면 된다.

 

참조

https://stackoverflow.com/questions/68775869/support-for-password-authentication-was-removed-please-use-a-personal-access-to

 

그럼 개발자들이여 다시 삽질하러 가자 ㅎㅇㅌ

반응형