git rebase 명령으로 커밋 메시지를 삭제할 수 있습니다.
사용하는 방법
USER-PC@DESKTOP-JAEGCLI MINGW64 ~/Desktop/gitstudy (master)
$ touch master.txt
USER-PC@DESKTOP-JAEGCLI MINGW64 ~/Desktop/gitstudy (master)
$ git add master.txt
USER-PC@DESKTOP-JAEGCLI MINGW64 ~/Desktop/gitstudy (master)
$ git commit -m "create master.txt"
(master (root-commit) d2ede23) create master.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 master.txt
USER-PC@DESKTOP-JAEGCLI MINGW64 ~/Desktop/gitstudy (master)
$ git commit -am "삭제할 메시지"
(master c785818) 삭제할 메시지
1 file changed, 1 insertion(+)
USER-PC@DESKTOP-JAEGCLI MINGW64 ~/Desktop/gitstudy (master)
$ git log --oneline
c785818 (HEAD -> master) 삭제할 메시지
d2ede23 create master.txt
USER-PC@DESKTOP-JAEGCLI MINGW64 ~/Desktop/gitstudy (master)
$ git rebase -i HEAD~1
Successfully rebased and updated refs/heads/master.
USER-PC@DESKTOP-JAEGCLI MINGW64 ~/Desktop/gitstudy (master)
$ git log --oneline
d2ede23 (HEAD -> master) create master.txt
git rebase -i HEAD~count 명령을 실행하면 git-rebase-todo 편집기 창이 열리고 커밋 메시지 상태가 drop으로 변경되며 편집기 창을 닫으면 커밋 메시지가 삭제됩니다.
참고로 카운트의 기본값은 마지막 커밋 메시지를 기준으로 적용할 개수입니다.