Git의 세 가지 영역 (Git Area)

Git의 세 가지 영역

(Three main sections of a Git project)

1. working tree (working directory)

working tree 혹은 working directory는 말 그대로 현재 작업 공간을 뜻한다. 이러한 working tree는 프로젝트의 특정 버전을 checkout한 것이다.

2. staging area (index)

staging area는 index라고도 불리며, Git directory에 포함된 파일이다. 다음에 commit할 파일들이 저장되어 있는 공간으로 이때, 파일들은 $ git add 명령어를 통해 staging area에 올라간다.

3. git directory (repository)

git repository에는 local repository와 remote repository가 존재한다. Local repository는 개인 PC에 파일을 저장하는 저장소이며, Remote Repository는 원격저장소로 공유를 위한 저장소로 동료들과의 협업을 가능하게 해준다.

remote repository를 $ git clone을 통해 받아오면 내 PC에 local repository가 만들어지게 된다.

이에 각각의 개발자는 우선 local repository에 작업 내용을 저장하며 개발을 진행하게 된다. 그리고 $ git push 명령어를 통해 작업내용을 동료들과 공유할 수 있다.

Leave a Reply

Your email address will not be published. Required fields are marked *