CHashtag

[Github] git clone with personal access token 해결방법 본문

Git

[Github] git clone with personal access token 해결방법

HyoSeong 2022. 9. 27. 10:40
반응형

어느날 git clone을 받으려하니 아래와 같은 에러와 함께 clone에 실패했다.

 

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.

 

대략 읽어보니,,

정책이 바꼈으니 아래 링크를 보고 personal access token을 이용하라는데,,

 

회사에서는 bitbucket을 쓰고, 개인 프로젝트도 대부분 public으로 두고 작업하다보니 이제서야 알아차린,,ㅋㅋ

 

각설하고, 본론으로 들어가겠습니다. 

 

personal access token 생성


github -> 오른쪽 상단 프로필 클릭 -> Settings

왼쪽 하단에 Developer settings

 

 

Personal access tokens -> Generate new token

적절히 권한과 기한을 설정 -> 하단의 "Generate token"

(잘 모르겠다면 repo, workflow, write:packages, gist, notifications, user, write:discussion 정도 체크하시면 되겠습니다.)

 

토큰이 만들어짐!

다만 이 토큰은 절대 누군가에게 보여주거나 공유해서는 안됩니다.

(계정의 비밀번호와 동일한 수준의 보안을 유지할 것을 권장드립니다.)

난 글 쓰자마자 Delete할거니까,, ㅋㅋ

 

위 token으로 다시 clone을 시도하면,,

 

$ git clone https://github.com/Hyo-Seong/aspdotnet-study.git
Cloning into 'aspdotnet-study'...
Username for 'https://github.com': hyo-seong
Password for 'https://hyo-seong@github.com': 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
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 7 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), 3.95 KiB | 212.00 KiB/s, done.

 

잘 되는것을 확인할 수 있습니다.

 

 

오늘도 도움이 되었길 바랍니다.

 

감사합니다.

반응형