오랜만에 개인 프로젝트를 시작했는데 쉬는 텀이 길다보니 매번 시작할때마다 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
이 명령어로 해결할 수 있음
'💻 Programming' 카테고리의 다른 글
brew update 오류 (couldn't find remote ref) (0) | 2024.07.03 |
---|---|
Spock Test Framework 실행 오류 해결 (2) | 2024.01.03 |
[IntelliJ] 신규 생성 프로젝트의 빌드 오류 (Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.2.1) (1) | 2024.01.03 |
SpringBoot 2.3 -> 2.5 업그레이드 후기 (0) | 2023.12.29 |
[AWS/SQS] cloudwatch datapoint 조회하기 (2) | 2022.12.29 |