git-authors
List Git repository contributors
TLDR
Print a full list of committers to stdout instead of to the AUTHORS file
Append the list of committers to the AUTHORS file and open it in the default editor
Append the list of committers, excluding emails, to the AUTHORS file and open it in the default editor
SYNOPSIS
git authors [options]
PARAMETERS
--format=<format>
Controls the output format of each author. Common formats might include 'name only', 'name and email', or custom patterns.
--output=<file>
Specifies an output file to write the authors list to, instead of standard output.
--sort=<key>
Sorts the authors list by a specified key (e.g., by name, by commit count). Available keys depend on the script.
<commit-range>
Limits the commits from which to extract authors (e.g., HEAD~10..HEAD or v1.0..).
DESCRIPTION
The git-authors command, typically implemented as a custom script or part of a Git extension suite (e.g., git-extras), is designed to extract a list of unique authors from a Git repository's commit history.
Its primary use is to generate an AUTHORS file or a similar compilation of contributors, often displaying their names and email addresses. It works by parsing the output of git log to identify unique author entries. While not a core Git command, it's a widely adopted utility for maintaining a clear record of who has contributed to a project. The specific output format and available options can vary based on the script's implementation, but the core functionality remains consistent: providing a clean, deduplicated list of all commit authors.
CAVEATS
git-authors is not a standard command shipped with Git itself. Its availability and behavior depend entirely on whether a specific script or Git extension (like git-extras) is installed and configured in your environment.
Implementations can vary significantly, leading to different options, output formats, and features.
It typically relies on parsing git log output, meaning it may not automatically handle Co-authored-by: lines in commit messages unless the specific script is designed to do so.
Requires a Git repository to be initialized and have commit history.
ACHIEVING SIMILAR RESULTS WITHOUT <I>GIT-AUTHORS</I>
Many of the functionalities of git-authors can be replicated using core Git commands:
To get a list of unique authors with their names and emails:
git log --format='%aN <%aE>' | sort -uf
To get a shortlog summary with commit counts:
git shortlog -sn --all
These commands demonstrate the underlying Git functionality that git-authors scripts often leverage.
HISTORY
git-authors is a community-driven utility rather than an official Git command. It emerged from the need to easily generate a list of contributors for projects, particularly for AUTHORS files. Various implementations exist, often as shell scripts or part of larger Git utility collections like git-extras, reflecting a common pattern of extending Git's core functionality with user-contributed scripts. Its development is decentralized, focusing on practical use cases for project documentation.
SEE ALSO
git-log(1), git-shortlog(1)