[Remote Repository 생성]
- Local Repository 에 연동할 Remote Repository 을 생성한다.
- Repository 에 접근할 용도로 사용할 Token을 생성한다.
( github에서 보안상의 이유로 더 이상 비밀번호를 사용하지 않고 Token을 사용하겠끔 한다고 한다. )
- Local Repository 에 Remote Repository를 등록한다.
git reomote add origin http://github.com/<repository>.git
다음과 같이 등록하면, 아이디와 토큰을 github과 연동할 때 마다 입력을 해주어야 한다.
- Remote Repository에 등록 with Username and Token
git remote add origin https://<username>:<token>@github.com/<repository>.git
이렇게 연동하면 매번 아이디와 토큰을 안써도 된다.
- remote repository 정보 확인
git remote -v
[실습]
- Local Repository와 같은 이름의 아무것도 없는 Remote Repository를 github에서 생성해줍니다.
- git 주소 copy
- github token 생성
settings > developer settings > personal access tokens > generate new token
주의! 토큰은 생성할 때 단 한번만 보여주고, 다시는 보여주지 않으니 잘 저장해놓아야한다.
- Remote repository에 등록 후 정보 확인
fetch url 과 push url 두 개가 뜨면 잘 연동 된거라고 한다.
'Git' 카테고리의 다른 글
[Git] 우분투 리눅스 깃 설치 및 클론 (0) | 2022.12.02 |
---|---|
[GIT] Push, Pull 해보기 (0) | 2022.07.09 |
[GIT] Local Repository (0) | 2022.07.09 |
[GIT] git 사용 준비 (0) | 2022.07.09 |
[GIT] 버전관리란? (0) | 2022.07.07 |