> For the complete documentation index, see [llms.txt](https://docs.sysout.co.kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sysout.co.kr/etc/github/github-integrated/branches.md).

# Branches

## Branches

eGit(Eclipse Git)을 이용하여 Branch를 관리하는 방법에 대해서 알아본다.

## Local Branch 생성

eGit을 이용하여 <mark style="color:blue;">Local Branch</mark>를 생성할 수 있다. <mark style="color:blue;">Local Branch</mark>를 만들고 원본 Branch와 별개의 작업을 수행할 수 있으며, 이는 <mark style="color:blue;">Local Repository</mark>에 저장된다. 필요한 경우 Remote Repository에 push할 수 있다. <mark style="color:blue;">Git Perspective</mark>의 Branches에서 생성 가능하다.

<div align="left"><img src="https://4208234536-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_TNZwLuHV9ipYLbvRq%2Fuploads%2FiYuN76ReayYOBAoBDohA%2Fimage.png?alt=media&amp;token=dc373004-24aa-4869-901c-a1d2e0a3b2c0" alt="Branch 생성 메뉴"></div>

<div align="left"><img src="https://4208234536-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_TNZwLuHV9ipYLbvRq%2Fuploads%2FQtIvwtmgoJzUzWNn10Zk%2Fimage.png?alt=media&amp;token=76f9c64e-bd76-4849-a9d0-d8381b491c6b" alt="Branch 이름 작성"></div>

sub라는 이름의 Branch 생성한 경우 다음과 같이 Local Branch 목록에 추가되며, 직전에 선택되어있던 Branch의 내용이 신규 Branch로 복제되고 해당 Branch가 선택되어 있게 된다.

<div align="left"><img src="https://4208234536-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_TNZwLuHV9ipYLbvRq%2Fuploads%2FVvdBqBfrMjaHbVJGobOA%2Fimage.png?alt=media&amp;token=b17523c5-2545-454c-8070-32b1a3e65863" alt="sub라는 이름의 Branch 생성"></div>

## Checkout

서로 다른 Branch 간에 Checkout이 가능하다. Checkout을 하게 되면 해당 Branch의 코드 상태가 Editor에 표시된다. Checkout은 해당하는 Branch를 더블클릭하거나 우클릭을 통하여 할 수 있다.

<div align="left"><img src="https://4208234536-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_TNZwLuHV9ipYLbvRq%2Fuploads%2FnrbTMZeSs42y84wLcx3j%2Fimage.png?alt=media&amp;token=1e80fe6a-03d4-45a1-be2f-d4718873d4e3" alt=""></div>

## Push Branch

현재의 Branch를 <mark style="color:blue;">Remote Repository</mark>에 Push한다. 존재하지 않는 Branch라면 생성된다.

<div align="left"><img src="https://4208234536-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_TNZwLuHV9ipYLbvRq%2Fuploads%2FvCY7gzJs2rxJnldfQBMX%2Fimage.png?alt=media&amp;token=530d90a2-a8c1-4941-92b2-6f75bf8b624a" alt=""></div>

## Remote Tracking

Remote Tracking은 <mark style="color:blue;">Remote Repository</mark> 중 설정한 패턴의 Branch 정보가 표시되는 영역이다. 해당 Branch로 Checkout 하여 코드를 확인하거나, Merge 등을 통한 병합 작업이 가능하다.
