Git 브랜치 워크플로의 예
물론 팀에 가장 적합한 브랜치 전략을 만들어야 합니다. 그러나 다음은 두 가지 유형의 브랜치(개발/통합 브랜치 및 기능/주제 브랜치)를 포함하는 브랜치 전략 워크플로를 따르는 방법에 대한 간단한 예입니다.
새 기능을 작업하고 있는데 누군가 프로덕션에서 버그를 발견했을 때 새 기능 작업과 동시에 해당 버그를 수정해야 한다고 가정해 보겠습니다.

버그 수정을 시작하기 전에 개발 브랜치에서 새 브랜치를 만듭니다. 이 새 브랜치는 작업 중인 새 기능에서 버그 수정을 분리합니다.

버그 수정을 릴리스할 준비가 되면 버그 수정 기능 브랜치를 개발 브랜치에 병합합니다.

그런 다음 원래 기능 브랜치로 다시 전환하고 새 기능에 대한 작업을 계속합니다.

기능 브랜치에서 새 기능을 계속 구현하려면 버그 수정 커밋인 커밋 "X"가 필요함을 알 수 있습니다. 즉, 현재 브랜치를 개발 브랜치의 변경 사항과 동기화해야 합니다.
이를 수행하는 데는 두 가지 옵션이 있습니다. 첫 번째는 커밋 "X"를 포함하는 개발 브랜치를 현재 브랜치와 병합하는 것입니다. 두 번째 옵션은 현재 브랜치를 커밋 "X"를 포함하는 개발 브랜치로 리베이스하는 것입니다.
이 예에서는 rebase 접근 방식을 사용합니다.

현재 작업 트리에 "X"가 있으면 새 기능에 대한 작업을 안전하게 다시 시작할 수 있습니다