—help

export GIT_PAGER=""

GIT_COMMITTER_DATE="$(git --no-pager log -1 --format='%ci')" \\
git commit --amend \\
  --author="$(git --no-pager log -1 --format='%an <%ae>')" \\
  --date="$(git --no-pager log -1 --format='%ai')" \\
  -m "새로운 커밋 메시지"
  
  
pip install git-filter-repo

# 사용 - 커미터를 작성자와 동일하게
git filter-repo --commit-callback '
commit.committer_name = commit.author_name
commit.committer_email = commit.author_email  
commit.committer_date = commit.author_date
' --refs HEAD~1..HEAD
# Git log format 기본 패턴: %{정보}{대상}
# {정보}: n=name, e=email, d=date
# {대상}: a=author, c=committer

# Author (작성자)
%an = author name           # John Doe
%ae = author email          # john@example.com
%ad = author date           # Mon Jan 15 14:30:22 2024 +0900
%ai = author date (ISO)     # 2024-01-15 14:30:22 +0900

# Committer (커미터)
%cn = committer name        # Jane Smith
%ce = committer email       # jane@example.com
%cd = committer date        # Mon Jan 15 15:00:00 2024 +0900
%ci = committer date (ISO)  # 2024-01-15 15:00:00 +0900

# 커밋 정보
%h  = 짧은 해시             # abc123f
%H  = 전체 해시             # abc123f456def789...
%s  = 커밋 메시지 제목       # Fix login bug
%b  = 커밋 메시지 본문       # 상세한 설명...

# 기타
%f  = 파일명용 제목         # fix-login-bug
%d  = ref names            # (HEAD -> main, origin/main)
%D  = ref names (no wrap)  # HEAD -> main, origin/main

외우는 팁: author, committer + name, email, date/iSO 조합!

제목 없음