티스토리 뷰

git

author 바로잡기

thingsu 2020. 11. 28. 22:46

// 커밋순서: acc0001 -> acc0002  
// 실제 해시값은 위처럼 순차적이지 않다. 설명의 편의를 위해서 부여함

// acc0002의 커밋 내용을 변경하려면..  
git rebase -i "변경할 커밋의 이전 커밋 해시값"  
// git rebase -i acc0001

git rebase -i "변경할 커밋의 해시값"^ // 캐럿(^): 해당 커밋의 이전 커밋을 가리킴  
// git rebase -i acc0002^
edit acc0002 커밋 메시지2  
pick acc0001 커밋 메시지1

# Rebase aaa0000..acc0001 onto acc0002 (2 command(s))

#

# 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

#

# These lines can be re-ordered; they are executed from top to bottom.

#

# If you remove a line here THAT COMMIT WILL BE LOST.

#

# However, if you remove everything, the rebase will be aborted.

#

# Note that empty commits are commented out

위와 같은 vi창이 뜨면 밖으로 나간 후 아래와 같이 입력

git commit --amend --author="사용자명 <이메일>"  

'git' 카테고리의 다른 글

fatal: the remote end hung up unexpectedly 오류 해결  (5) 2021.05.23
git author 한번에 모두 바꾸기  (0) 2021.02.04
config 수정하기  (0) 2020.11.28
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday