github 인증

Code 2026. 3. 2. 14:25

git 로컬 저장소와 github 원격 저장소 연결 방법
    - github에 올리기

1. 원격 저장소 설정
git remote add origin https://아이디@github.com/저장소


    - 위 설정 변경(인증 설정 변경) - 위 명령을 했으면 필요없음
git remote set-url origin https://아이디@github.com/저장소


2. 인증 저장 방식 설정
git config credential.helper manager


3. upstream 설정
git push --set-upstream origin main

    - github  인증이 실행되고 결과가 기억된다.

 

 

-------------------------------------------------------------------------------
* 저장소 연결시 마다 인증창이 뜨는 경우
     - 여러계정이 설정된 경우 , 연결시 마다 로그인 선택 창(credential-manager.exe)이 뜨는 막는 방법

 


     - 특정 계정으로 자동 로그인 설정 방법
---------------------------------------
<방법1>
git remote set-url origin https://아이디@github.com/저장소
     - .git\.config 파일 변경됨
[remote "origin"]
url = https://github.com/저장소 가
url = https://아이디@github.com/저장소 로 변경됨

 


---------------------------------------
<방법2>
     - 아래 명령에서 --global을 빼면 현재 저장소에만 설정됨
git config --global credential.https://github.com.username <githubID>

     - 인증시 URL의 path 부분까지 포함해서 구분하게 설정
git config --global credential.https://github.com.useHttpPath true

     - .git\.config 파일이 수정됨
[credential "https://github.com"]
    username = <githubID>
    useHttpPath = true

 

 

반응형
Posted by codens