You've successfully subscribed to Nicholas Workshop
Great! Next, complete checkout for full access to Nicholas Workshop
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

Change Author Info For Old Commits in Git

Nicholas Wong
Nicholas Wong

While using hit, it is really usual to have regrets on the commits done, especially the name used. In order to change those information in your repository, open terminal (or cmd in windows), go to the folder of your git repositoy, and run the following commands.

Remember, replace “old_name”, “new_name” and “new@email.address” with your own information.

git filter-branch –commit-filter '  
    if [ "$GIT_COMMITTER_NAME" = "old_name" ];  
        git commit-tree "$@";  
        git commit-tree "$@";  
    fi' HEAD  

Nicholas Wong

Fullstack software engineer with strong background in computer science and extensive experience in software engineering and architecture. Studied in NYU, worked in Yahoo, Rakuten and Manulife.