📝 Edit page
➕ Add page
Authors
Show author names and their contributions to a repo
Show
In a Git repo, show a summary of GitHub users (using author names) and the number of commits by each, sorted by commit count.
$ git shortlog -n -s
969 michaelcurrin
123 MichaelCurrin
116 Alessio Benvenuti
For more info, see the shortlog command.
Edit
Change the author of a commit.
Edit one commit
If you just want to change the most recent commit, a rebase is not necessary. Just amend the commit:
$ git commit --amend --no-edit --reset-author
Edit range of commits by hand
How to update one commit at a time, using Git manually one command at a time.
Note that this convenient for fixing a handful of commits, but is inefficient for changing a lot of commits.
- Set your new author name and email in a variable. e.g.
$ export AUTHOR="John Doe <john@doe.org>"
- Start a rebase, starting with one commit before the first commit you want to update.
$ git rebase -i -p COMMIT_REFERENCE
e.g. use the carat and the target first commit to get one commit before it.
$ git rebase -i -p fd27b00ac^
- Change
pick
toedit
ore
for each commit where you want to change the author. Warning - this will replace the author regardless of who it was. - Save the content in the editor view then exit.
- Now you adjust each commit one at a time with these two commands:
$ git commit --amend --author="$AUTHOR" --no-edit $ git rebase --continue
Bulk editing
Replace the author across the history of commits, using a single command.
See MichaelCurrin/rewrite-git-author repo.