여기서는 Local PC > Github로 코드를 Push 하기 위한 권한 및 절차를 정리한다.
HTTPS 방식을 통한 코드 푸시 방법을 알아보도록 한다.


생성된 Token은 복사해서 저장한다. 다시 볼 수 없으니 잘 저장해놓기
기존에 등록되어 있는 자격증명이 있는 경우 git push가 되지 않았다.
아래 그림과 같이 접속해서, 필요없는 git 자격증명을 삭제해주면 된다.

먼저, 로컬과 원격 저장소의 상태를 확인
git remote -v
git remote remove origin
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git
git push origin main
강제 푸시는 위 최후의 보루!
git push --force origin main
그럼에도 발생한 에러...
git push origin main
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcm/tlsverify for more information.
To https://github.com/clouderling/amplify-repo.git
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'https://github.com/clouderling/amplify-repo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git config --global http.sslVerify true
git pull --rebase origin main
