GIT

[GIT] Gerrit에서 Cherry-Pick 하기

수노 SUNHO 2017. 12. 13. 11:37


1. cherry-pick 시작


$ git fetch ssh://abc@defg.xyz:29418/`프로젝트 이름` refs/changes/07/207/16 && git cherry-pick FETCH_HEAD




2. 충돌되는 파일 정리


$ git status




3. 충돌되는 파일 정리하고 적용하기

 

$ git cherry-pick --continue




4. PUSH 하기

 

$ git push origin HEAD:refs/for/`브랜치 이름`




만약 아래의 에러가 발생한다면 

Squash the commits with the same Change-Id or ensure Change-Ids are unique for each commit



$ git rebase -i HEAD~2


위의 명령어를 실행하고


pick ca45e12 one commit pick 13d3812 another commit


pick ca45e12 one commit squash 13d3812 another commit


아래의 pick을 squash로 변경한 후, 저장하고 나가기



그리고 PUSH 하면 끝!

'GIT' 카테고리의 다른 글

[Github] fork, 포크  (0) 2019.03.25
[GIT] Slack에 Gerrit 알림 보내기  (0) 2017.11.22
[GIT] Mac OS에서 xcrun error 발생시 대처 방법  (2) 2017.11.17
[Git] Stash  (0) 2017.08.07
[Git] Squash 해결  (0) 2017.08.07