본문 바로가기
개발 환경세팅/Git, Github

[Github] 원격 저장소 ssh 연결 및 설정(git remote, git config)

by minhyeok.lee 2023. 2. 4.
반응형

깃허브 ssh 관련 연결, 해제, 연결 후 설정( git remote, git config) 명령어


1. Repository 원격 연결 확인

$ git remote -v

2. Repository 연결 

$ git remote add origin '[클론 주소]'

 

클론 주소 위치
클론 주소 위치

 * 깃허브 우측 상단 <> Code를 누른 이후 나오는 주소를 복사하고 붙여넣으면 된다.


3. Repository 연결 해제

$ git remote remove origin

4. 특정 이름으로 연결 및 해제

$ git remote '( add or remove )' '( origin or 하고싶은 이름)'

 

 

이름, 주소 연결 하는 방법(전역 설정)

repository와 ssh 연결이 되어있어야 함(위 Repository 연결)

 

5. config 명령어로 user의 이름을 설정 (전역)

$ git config --global user.name "your name"

6. config 명령어로 user의 이메일을 설정(전역)

$ git config --global user.email "you@gmail.com"

7. 이름, 주소 연결 (개별 저장소의 설정)

$ git config user.name "your name"
$ git config user.email "you@gmail.com"

8. 전역 설정을 삭제

$ git config --global --unset user.name
$ git config --global --unset user.email

9. 개별 저장소의 설정을 삭제

$ git config --unset user.name
$ git config --unset user.email

 

반응형

댓글