study/Error
git Username, Password ...
xoxowo
2023. 8. 14. 12:13
❗ 새 레포에 연결하고 작업물을 push 할 때 username과 password 입력해야하는 인증 단계가 생겨 구글에 검색 후 해결했었는데, 또 동일한 상황이 반복되어 해결방법 중 제일 빠르게 해결한 방법을 정리해봤다.
※ error는 아니지만..
→ 터미널
yujeong@MacBookPro ss % git push origin main
Username for 'https://github.com': xoxowo
Password for 'https://xoxowo@github.com':
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/xoxowo/ㅇㅇㅇㅇㅇ.git/'
📌 해결 방법
깃 허브 내 계정 setting에 아래 루트로 들어가 토큰을 발급받고 터미널에서 아래 명령어로 복사한 토큰, 이름, 레포 주소를 넣으면 제대로 git 레포에 작업한 commit이 업로드된다!
github → <>Developer Settings → Personal access tokens → Tokens → Generate new token (repo만 선택)
→ (명령어 작성 시 ' ' 는 제외)
git remote set-url origin https://`토큰복붙`@github.com/`username`/`gitrepo주소`.git
ex) git remote set-url origin https://aasdfkwej-j@github.com/xoxowo/firstrepo.git
git push