git rebase

Seunghyunkim1·2020년 5월 17일

wecode

목록 보기
23/25

https://learngitbranching.js.org/?locale=ko

마스터랑 브랜치랑 머지하면
깃 시각에서는 다른 하나의 브랜치이다 ??
2가지 종류

  • fast forward
  • merge commit 생김

re-base
베이스를 최신 커밋?으로 바꾼다
그리고 다시 브랜치를 시작한다.

  • 장: history를 깨끗히 하기위해서함
  • 단: conflict엄청남 (커밋수만큼 충돌수날수잇음)

보통 rebase + squash
여러개의 커밋들을 하나의 커밋으로 만들어서 머지한다

git checkout master
git pull origin master //마스터최신화
git rebase -i master feature/파일이름 // 리베이스

브랜치에서는 git rebase -i master

squash 자체가 커밋이 일어나는것

  • 충돌해결, 내용수정후 add. 만해도 커밋이 자동임
    git add .
    git rebase --abort // 리베이스 자체를 중단
    git rebase --continue

    git push origin feature/파일이름

0개의 댓글