git commit
커맨드에 --amend
플래그를 붙이면 직전에 남긴 커밋을 수정할 수 있음
마지막 커밋에 변경사항을 추가하고 커밋 메시지를 변경할 것임
$ git log
commit f01c8c09f09e14063feb13b24be592e507ea365b (HEAD -> main)
Author: yourname <yourname@yourmail.com>
Date: Mon Jul 16 23:17:56 2012 +0900
EDITED: append description of the add command
commit 0de54de5d846d5fb800cf0f4d74f0c79d2e0a186
Author: yourname <yourname@yourmail.com>
Date: Mon Jul 16 23:16:14 2012 +0900
first commit
sample.txt
파일을 수정하고 저장
$ git add sample.txt
$ git commit --amend
# 최신 커밋 메시지가 포함된 기본 편집기가 열림
# -> 커밋 메시지 수정 후 저장
$ git log
commit e9d75a02e62814541ee0410d9c1d1bf47ab1c057
Author: yourname
Date: Mon Jul 16 23:17:56 2022 +0900
Add direction of the Add and the Commit
commit 48eec1ddf73a7fb508ef664efd6b3d873631742f
Author: yourname
Date: Mon Jul 16 23:16:14 2022 +0900
first commit
[nulab] 커밋 수정
[Chamming2] 당신이 찾던 커밋 수정법, git commit --amend 사용하기