in Technology by
How to change the author and committer name and e-mail of multiple commits in Git?

1 Answer

0 votes
by

Specifically, you can fix all the wrong author names and emails for all branches and tags with this command (source: GitHub help):

#!/bin/sh

git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
    export GIT_COMMITTER_NAME="$CORRECT_NAME"
    export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
    export GIT_AUTHOR_NAME="$CORRECT_NAME"
    export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags

Related questions

0 votes
    2.A feature of Microsoft Word which is used to create multiple copies of letters and e-mails is (a) Mail (b) ... merge (d) data source Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    How to delete unpublished Git commits and get rid of them permanently? A. git reset –hard B. git revert C. git reset –soft...
asked Dec 20, 2022 in Technology by JackTerrance
0 votes
    Explain How can we make Git use the editor of my choice for commits?...
asked Jan 8, 2021 in Technology by JackTerrance
0 votes
    I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git ... for a single project. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    git reflog tracks the commits that are made and the commits that are discarded. A. True B. False...
asked Dec 24, 2022 in Technology by JackTerrance
0 votes
    What is the Git command to view the last three commits in a line? A. git last 3 commits B. git log -–oneline -3 C. git show log -3 D. git log...
asked Dec 23, 2022 in Technology by JackTerrance
0 votes
    What is the Git command to view all the commits since 1st January 2017 ? A. show git log since Jan 1 2017 B. git log ... =”2017-01-01” C. git log D. None of the options...
asked Dec 21, 2022 in Technology by JackTerrance
0 votes
    What is the Git command to view the last 3 commits in one line ? A. git show log -3 B. git last 3 commits C. git log D. git log -–oneline -3...
asked Dec 21, 2022 in Technology by JackTerrance
0 votes
    What is mean by 'src refspec master does not match any when pushing commits in Git?...
asked Jan 8, 2021 in Technology by JackTerrance
0 votes
    I would like to know how to delete a commit. By delete, I mean it is as if I didn't make that commit, ... -hard HEAD. Is this correct? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Which of the following input control is used for input fields that should contain an e-mail address in Web Form 2.0? A - email B - url C - number D - range...
asked Dec 2, 2020 in Technology by JackTerrance
0 votes
    56. What kind of etiquettes is speaking clearly and slowly? (A) e mail (B) telephonic (C) letter (D) none Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    56. What kind of etiquettes is speaking clearly and slowly? (A) e mail (B) telephonic (C) letter (D) none Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    56. What kind of etiquettes is speaking clearly and slowly? (A) e mail (B) telephonic (C) letter (D) none Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    I have an application I'm building with Firebase. Essentially, I'm trying to build an authentication system ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
...