오랜된 포스팅/IOS

Xcode 로컬프로젝트 Github 연동방법

Toycode 2021. 6. 7. 15:28

1. Github

Personal access token list

a. 먼저, 우측상단 프로필 아이콘 > Settings > Developer settings > Personal access tokens > Generate new token

 

Generate personal access token

b. 토큰 명 및 허용범위를 선택해 줍니다. (필자는 repo만 선택하였습니다.)

 

Created Token and copy

c. 토큰이 생성되고 나면 "복사하기" 아이콘을 클릭하여 복사해줍니다.

 

2. Xcode

Accounts

a. "command + ," 단축키를 통해 Preferencese > Accounts > + > Github 을 진행해 줍니다.

 

Sign in Github

b. Github 계정 정보와 이전 단계(step: 1-c)에서 발급받은 토큰 값을 넣어줍니다.

Create new project

c. Xcode에서 새로운 프로젝트를 생성합니다. 단, "Create Git repository on my mac" 항목에 체크해 주세요.

 

Created .git directory

d. 프로젝트를 생성하고 나면 로컬경로에 .git 디렉토리가 생겨있습니다.

 

Source Control navigator

e. 프로젝트 생성 후 소스컨트롤러를 확인해 보면 Remotes(원격저장소)에 아무런 값이 없는 걸 확인 할수 있습니다.

 

New ... Remote

f. 원격 저장소 추가

 

remote setting

g. 저장소 생성하기