본문 바로가기

IT/Git

이미 push한 commit 메시지 수정

 

 

git rebase HEAD~거슬러올라가고 싶은 커밋 수 -i 를 실행하면,

 

pick ce6a857 revise "manager/userinfo.jsp" revise "3 cards(user information) are not in a row" by counting in jsp if statementpick 6bfb747 Add "reviseTrainerInformation By Manager"

pick 9710b50 Revise "deleteMember & deleteTrainer By Manager" "set member.trainer_id='NULL' when member's personal trainer is deleted and print all of Members' information including members having null trainer"

 

요런 비슷한게 뜰거다. 뒤에 긴 내용은 내 커밋메시지이고(작문 실력 패스)

앞에 pick이 중요하다 

 

# Commands

# p, pick = use commit

# r, reword = use commit, but edit the commit message

# e, edit = use commit, but stop for amending

# s, squash = use commit, but meld into previous commit

# f, fixup = like "squash", but discard this commit's log message

# x, exec = run command (the rest of the line) using shell

# d, drop = remove commit

 

 

 

여기 잘 설명이 되어있는데, reword라는 키워드를 사용하면 커밋메시지만 수정할 수 있다.

 

i를 눌러 편집 모드로 들어간 뒤 수정할 커밋 메시지 앞의 pick을 reword로 수정한 뒤 저장하면(:wq!)

차례대로 해당 커밋메시지를 수정할 수 있는 편집기로 이동하게 된다.

 

모든 메시지를 수정하고(:wq!)나서

 

 

git push --force

 

를 실행해준 뒤 저장소를 다시한번 가주자!

그럼 메시지가 잘 수정된 것을 확인할 수 있다.

 

 

[Git] 이미 push한 커밋 메시지 수정하기

버전관리라고 하긴 부끄럽고 그냥 얼마나 자주 개발하는지 기록하고 있어서 깃에 지속적으로 업데이트하고 있는데,, 아 시간이 지날수록 커밋 메시지가 통일성 없고 특히 초반에 한글로 쓴 것��

a1010100z.tistory.com

 

'IT > Git' 카테고리의 다른 글

git merge 후 pull 실패 시 해결 방안 - You have not concluded your merge (MERGE_HEAD exists)  (0) 2020.10.05
git 일반적 명령어 정리  (0) 2020.09.25
readme 파일 작성법  (0) 2020.09.24
[Git] 과정 도식  (0) 2020.09.24
remote repository  (0) 2020.09.15