git branch [브랜치명]
git checkout [브랜치명]
git branch -d [브런치명]
다른 브랜치에 있는 커밋을 선택적으로 내브랜치에 적용시키때 사용하는 명령어 이다.
명령어는 아래와 같다.
git cherry-pick <commit_hash_1> <commit_hash_2>....
git cherry-pick 76ae30ef
git cherry-pick 13af32cc
위처럼 한개씩 cherry-pick 명령어로 가져와 브랜치x에 적용 시키는 방법도있고,
git cherry-pick 76ae30ef 13af32cc
위처럼 commit hash를 나열해주면 여러개를 한꺼번에 내브랜치x에 적용시킬수 있다.
git cherry-pick --abort
명령어를 사용해 cherry-pick을 준단하면, cherry-pick을 하기전 상태로 돌아갈수 있다.
만약 merge commit을 cherry-pick 하고 싶다면 아래 명령어를 사용하면 된다.
git cherry-pick -m 1 <merge_commit_hash>