따꿍의 프로젝트

[2026.02.24] 다른 브랜치 작업 현 브랜치로 옮기기 (Cherry-Pick) 본문

웹프로젝트/졸작

[2026.02.24] 다른 브랜치 작업 현 브랜치로 옮기기 (Cherry-Pick)

공장 주인 따꿍 2026. 2. 24. 21:39

1. Auto Commit하는 Cherry-Pick

git cherry-pick <commit-hash>

 

+ 만일 conflict가 있을 시

 

+ 여러개의 commit을 cherry-pick하고 싶을 시

 

+ 그 브랜치 전체를 가져오고 싶은거면 cherry-pick보다는

rebase나 merge가 나을수도 있다. 

2. Auto Commit 없는 Cherry-Pick

커밋하기 전에 잘 돌아가는지 테스트하고 싶을 때 사용한다. 

git cherry-pick -n <commit-hash>
//아니면
git cherry-pick --no-commit <commit-hash>

 

3. 문제가 생겨서 Cherry-Pick 취소하고 싶을 때

git cherry-pick --abort