기타/git

    git rebase 사용해서 커밋 병합하기

    커밋을 병합할 일이 있어서 예전에 배웠던 git rebase를 사용해서 커밋을 합쳐봤습니다! git rebase -i HEAD~2 뒤에 숫자는 병합할 커밋의 개수만큼 입력하는 것이고 rebase 은 i옵션은 -interactive의 약어입니다! 병합할 커밋을 squash옵션을 넣어주고 병합될 대상을 pick해주면 됩니다 pick b test1 squash c test2 # Rebase a..c onto a # # 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 me..