오랜만에 개인 프로젝트를 시작했는데 쉬는 텀이  길다보니 매번 시작할때마다 git 관련 오류때문에 구글링하는 시간이 아까워 기록용으로 남깁니다.

 

소스 코드 작성하고 이런저런 테스트 해보고 github repo 생성후에 push 하려고 했는데 

% git init

% git remote add origin {github url}

% git push --set-upstream origin main
Password for 'https://aaaaaa@github.com': 
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/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/aaaaaa/test.git/'

 

이렇게 에러가 난다면 Password 란에 Personal Access Token(PAT) 값을 넣어주면 됨.

PAT 는 github계정설정 (repo 설정 아님) > Developer Settings > Personal access tokens (classic) 에서 발급받을 수 있음.

 

 

그리고 브랜치 이슈로 아래와 같은 에러가 발생한다면..

 % git checkout main
branch 'main' set up to track 'origin/main'.
Switched to a new branch 'main'
% git merge prod
fatal: refusing to merge unrelated histories

 

% git merge prod --allow-unrelated-histories

이 명령어로 해결할 수 있음