rebase --onto
- server 브랜치에서 출발한 client 브랜치를 master 브랜치로 리베이스하고자 한다.
- rebase의
--onto
옵션으로 옮긴다. git rebase --onto [base] [from] [to]
$ git rebase --onto master server client
- master로 (server, client] 범위를 리베이스하겠다는 의미.
- client 브랜치의 변경 사항들이 master 브랜치로 리베이스된다.
- 특정 커밋 범위를 지정할 수도 있다.
- 39a527 다음 커밋부터 8772ea 커밋까지 master로 리베이스된다.
$ git rebase --onto master 39a527 8772ea
참고자료
- “Git Branching - Rebasing”, git-scm.
- Xmanoux, “I can’t understand the behaviour of git rebase --onto”, 2015.