버전 비교
비교대상
키
- 이 줄이 추가되었습니다.
- 이 줄이 삭제되었습니다.
- 서식이 변경되었습니다.
목차 |
---|
Rebase는 커밋을 새로운 부모 커밋으로 옮기는 기능을 제공한다.
Push된 history를 rebase 하지 않도록 주의한다. 이 경우 history를 기반으로 작업하고있는 개발자들에게 영향을 주게된다.
다음 명령은 현재 working branch의 커밋을 <base> branch로 옮긴다.
코드 블럭 |
---|
git rebase <base> |
git rebase의 기본 동작은 non-interactive이며, interactive mode (--interactive, -i)로 editor를 이용할 수 있다.
코드 블럭 |
---|
git rebase -i new-base-branch |
editor 화면:
코드 블럭 |
---|
pick 2231360 some old commit
pick ee2adc2 Adds new feature
# Rebase 2cf755d..ee2adc2 onto 2cf755d (9 commands)
#
# Commands:
# p, pick = use commit (커밋 사용)
# r, reword = use commit, but edit the commit message (커밋 메시지 변경)
# e, edit = use commit, but stop for amending (커밋 수정을 위해 자동 수행 멈춤)
# s, squash = use commit, but meld into previous commit (이전 커밋에 포함)
# f, fixup = like "squash", but discard this commit's log message (이전 커밋에 포함)
# x, exec = run command (the rest of the line) using shell (명령 수행)
# d, drop = remove commit (커밋 삭제) |
editor를 종료하면 선택한 명령이 일괄 수행된다.
Image Added
발췌 포함 | ||||
---|---|---|---|---|
|