Open DrMaemi opened 3 days ago
git log --online
$ git log --oneline 1076128 (HEAD -> master, origin/master, origin/HEAD) [java] log4j2, slf4j<EB> <A5><BC> <EC><9D><B4><EC><9A><A9><ED><95><9C> logging <EC><98><88><EC><A0><9C> <EC><B6><94><EA><B0><80> 8894c93 Java <EC><98><88><EC><A0><9C> <EC><BD><94><EB><93><9C> - Steam API Call 34fd9f8 Initial commit
git rebase -i ${변경할 커밋의 해시값}^ git rebase -i ${변경할 커밋의 이전 커밋의 해시값} # 처음부터 모든 commit을 변경해야 하는 경우 git rebase -i --root
git rebase -i 1076128^
pick ${hash} ${commit_message}
pick
edit
e
$ git rebase -i --root
# vim 에디터에서 직접 수정 $ git commit --amend # 또는 옵션을 사용하여 직접 수정하기 전에 미리 수정 내용을 반영할 수 있다. $ git commit --amend --author="$ID<$EMAIL>" -m "$COMMIT_MESSAGE"
git commit --amend
git rebase --continue
1. 원하는 commit 수정
1.1. 대상 commit hash 확인
git log --online
등으로 확인1.2. rebase 명령어 실행
1.3. 수정할 commit 지정
pick ${hash} ${commit_message}
형태로 적혀있는 부분에서pick
을edit
또는e
로 수정1.4. commit 수정
edit
으로 지정한 commit 수만큼git commit --amend
명령어로 vim 에디터 등을 통해 commit 내용을 수정할 수 있다.git rebase --continue
명령어를 사용한다.A. 참조