Local Repository
Local Repository 구성
Local Repository 는 Git 이 관리하는 3가지 단계로 구성되어 있음
- Working Directory (작업공간) - 실제 소스 파일, 생성한 파일들이 존재
- Index (Stage) - Staging area (준비영역) 의 역할, git add 한 파일들이 존재
- HEAD - 최종 확정본, git commit 한 파일들이 존재

Workspace 생성

Working Directory 생성
- Workspace 로 이동한 뒤 Working Directory 생성

Git init
- 폴더에서 Git 을 초기화하는 명령어를 사용하면 해당 폴더를 Git 이 관리하기 시작

파일 생성
- Working Directory 에 파일을 생성
- 참고> touch 명령어 - 빈 파일을 생성

Git Status

Git Add
- Working Directory 에서 변경된 파일을 Index (stage)에 추가

Git Commit
- Index (stage) 에 추가된 변경사항을 HEAD 에 반영 (확정)

Remote Repository
Remote Repository 생성
- Create respository 버튼 클릭
- 프로젝트 이름을 설정한 뒤 빈 프로젝트 상태로 > Create repository 클릭
- Remote Repository 생성 확인
- Github Token 생성
- 얼마전부터 보안상의 이유로 Remote Repository 접속 시 비밀번호 대신 Token 을 사용
- 사용자 메뉴에서 Settings 선택
- Developer settings 선택
- Personal access tokens 선택
- Generate new token 선택
- Token 이름 입력 + No expiration 을 선택 + repo 선택 > Generate token 버튼 선택
- Token 생성 완료 - 이후에는 Token 값이 보이지 않으므로 반드시 잘 복사.
Remote Repository 등록
- Local Repository 에 Remote Repository 등록

- Remote Repository 등록 with Username and Token


Remote Repository 에 변경내용 Push 하기
- Local Repository (HEAD) 에 반영된 변경내용을
Remote Repository 에도 반영하기 위해서는 Git Push 를 사용
Git Push

Local Repository 에 Pull 하기
- Remote Repository 의 내용에 맞춰 Local Repository 를 갱신하려면 Git Pull 사용
Git Pull

Remote Repository 복제하기
- Local Repository 를 생성하지 않은 상태에서
Git Clone 명령을 사용하여 Remote Repository 를 Local 에 복제할 수 있음
Git Clone
- 앞서 폴더를 만들고
- Git Init 으로 해당 폴더를 초기화 하고
- Remote Repository 를 등록하고
- Remote Repository 의 내용을 Pull 하는 모든 과정을 Git Clone 으로 할수 있음

- Git Clone with username and token
