1.브랜치(Branch)
브랜치(branch)는 버전 관리 시스템에서 사용되는 개념으로, 주로 Git과 같은 분산 버전 관리 시스템에서 찾을 수있다.
1-1.병렬개발
여러 개발자가 동시에 다양한 기능을 개발할 수 있도록 독립적인 작업 공간을 제공한다,
각각의 브랜치는 특정 기능이나 수정 사항을 개발하기 위한 공간으로 활용된다.
1-2.안정성 보장
메인 브랜치는 항상 안정된 상태를 유지한다.
개발자들은 새로운 기능을 실험하거나 수정사항을 테스트하기 위해 메인 브랜치를 건들이지 않고 독립적인 브랜치에서 작업할 수 있다.
1-3.이력 관리
각각의 브랜치는 고유한 개발 이력을 가지고 있습니다. 이는 코드 변경 사항을 추적하고, 필요한 경우 이전 상태로 쉽게 돌아갈 수 있도록한다.
1-4.배포 관리
브랜치는 종종 환경별로 코드를 관리하고 배포하는 데 사용된다.
예를 들어, 개발 환경, 테스트 환경, 프로덕션 환경 각각에 대해 별도의 브랜치를 유지할 수 있다.
2.병합(Merge)
병합은 두 개의 다른 브랜치의 내용을 하나로 합치는 작업을 말한다.
브랜치 통합: 각자 독립적으로 개발한 기능이나 수정 사항을 메인 브랜치에 통합할 때 사용된다.
3.병합과정
3-1.대상 브랜치로 이동
병합을 받을 대상 브랜치로 이동합니다. 예를 들어, main 브랜치로 이동한다.
git checkout main
3-2.병합할 브랜치 병합
대상 브랜치에 다른 브랜치를 병합합니다. 예를 들어, feature 브랜치를 main 브랜치에 병합한다.
git merge feature
4.리베이스(Rebase)
Git에서 브랜치의 이력을 재배치하는 작업을 말한다.
리베이스는 기존 브랜치에서 새로운 커밋을 만들어내기 때문에, 이력이 선형적으로 깔끔하게 유지된다.
일반적으로 개인적으로 작업할 때, 혹은 특성 브랜치를 메인 브랜치와 통합할 때 리베이스를 사용한다.
'Computer Science > GIT,GITHUB' 카테고리의 다른 글
[Github] GitHub Package (0) | 2024.07.10 |
---|---|
[Github] 리포지터리(Repository) (0) | 2024.07.10 |
[Github] Git 명령어모음1 (0) | 2024.07.10 |