version control - Change the author and committer name and e-mail of multiple commits in Git -
i writing simple script in school computer, , committing changes git (in repo in pendrive, cloned computer @ home). after several commits realized committing stuff root user.
is there way change author of these commits name?
changing author (or committer) require re-writing of history. if you're okay , think it's worth should check out git filter-branch. main page includes several examples started. note can use environment variables change name of author, committer, dates, etc. -- see "environment variables" section of git man page.
specifically, can fix wrong author names , emails for branches , tags command (source: github help):
#!/bin/sh git filter-branch --env-filter ' old_email="your-old-email@example.com" correct_name="your correct name" correct_email="your-correct-email@example.com" if [ "$git_committer_email" = "$old_email" ] export git_committer_name="$correct_name" export git_committer_email="$correct_email" fi if [ "$git_author_email" = "$old_email" ] export git_author_name="$correct_name" export git_author_email="$correct_email" fi ' --tag-name-filter cat -- --branches --tags
Comments
Post a Comment