본문으로 건너뛰기

Git commit 메시지 수정하기

Fix Commit Message​

깃 커밋메시지를 작성하다보면 오타가 나거나 메시지를 잘못 적는 경우가 생긴다

$ git add --all
$ git commit -m "update commetn"

--amend 옵션을 사용하여 커밋 메시지를 수정하면 된다

$ git commit --amend
1 update commetn
2
3 # Please enter the commit message for your changes. Lines starting
4 # with '#' will be ignored, and an empty message aborts the commit.

수정이 끝났으면 저장 후 종료하고 git log -n 1 명령어를 통해 확인해보면 된다

$ git log -n 1
update comment