Git 로그의 이메일 주소 다 바꾸기

  • Post author:
  • Post category:칼럼
  • Post comments:0 Comments
  • Post last modified:February 24, 2014

Assembla과 같은 호스팅 서비스에 Git 저장소가 있다. 그리고 Git 저장소의 커밋 로그, 그 중에서도 커밋한 사람의 이름과 이메일 주소를 바꿔야 하는 상황이다. 이럴 때는 다음과 같이 한다.

  1. 기존 저장소를 모두 복사해온다.

    git clone --mirror [oldUrl]
    
  2. Git Tools – Rewriting HistoryChanging E-Mail Addresses Globally에 나온대로 명령 줄 스크립트를 작성한다.

    git filter-branch --commit-filter '
        if [ "$GITAUTHOREMAIL" = "schacon@localhost" ];
        then
                GITAUTHORNAME="Scott Chacon";
                GITAUTHOREMAIL="[email protected]";
                git commit-tree "$@";
        else
                git commit-tree "$@";
        fi' -- --all
    
  3. 이렇게 변경한 로컬 저장소를 Assembla에 새로 만든 저장소에 올린다.

    git push [email protected]:newproject.git --mirror
    

끝!

Author Details
Kubernetes, DevSecOps, AWS, 클라우드 보안, 클라우드 비용관리, SaaS 의 활용과 내재화 등 소프트웨어 개발 전반에 도움이 필요하다면 도움을 요청하세요. 지인이라면 가볍게 도와드리겠습니다. 전문적인 도움이 필요하다면 저의 현업에 방해가 되지 않는 선에서 협의가능합니다.
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments