기본 콘텐츠로 건너뛰기

5월, 2020의 게시물 표시

Git 깃 커밋한 날짜와 시간 변경 방법

 Git 깃 커밋한 날짜와 시간 변경 직전 커밋은 git log로 검색해서 Date:    Thu May 14 09:55:56 2020 +0900 부분 복사하고 git commit --amend --no-edit --date "Thu May 14 13:15:56 2020 +0900" 시간 수정해서 커밋하면 끝~ 혹시 현재 날짜로 변경하고 싶다면 git commit --amend --no-edit --date "$(date)" 이렇게 사용하면 된다 문제는 그 이전의 커밋을 수정할 때는 git log를 통해서 commit의 고유값을 복사 후 리베이스를 실행함 git rebase  - i 37ef02220d4f49e7e638ca4b3aee604e2ff9c9e9 cs 커밋 수정을 치면 git commit  - - amend cs 이런식으로 나오는데 수정을 원하는 커밋한 내용앞의 pick를 edit으로 바꿔주고 저장 후 종료 pick 9a54fd4 commit의 설명 추가 pick 0d4a808 pull 설명을 추가   # Rebase 326fc9f..0d4a808 onto d286baa # # 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 # # If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove every