Contents
RebaseGit rebase를 활용하여 Git log를 체계적으로 관리할 수 있다.
맨 처음 로그(init)는 수정불가

Rebase
git rebase -i HEAD~3 // 최근 3개의 로그가 보임
- reword 해보기

처음 일반 모드에서 입력 모드로 변경

위와 같이 수정 후 명령행 모드에서 저장 후 나가기 실행

입력 모드에서 로그인 꾀병부려서 퇴근 → 로그인 아파서 퇴근으로 수정 후 명령행 모드로 저장 후 나가기 실행

reword 완료
- drop 해보기

pick → d로 수정 후 저장 후 나가기

삭제 완료
git reflog // 모든 로그 보기(rebase된 것도 보여줌)
해쉬코드 4자리를 외운 후 다시 삭제전으로 되돌리기(작성자의 해쉬코드는 fdc3)
reset코드를 이용하여 되돌림

reset 완료
-squash 해보기

위와 같이 수정 후 저장 후 나가기

위와 같이 나오는데 자신이 원하는 이름 하나만 남기고 다 삭제(일반 모드에서 dd 사용)

저장 후 나가기

squash 완료
Share article