Git Commit Identity, Authentication and Signatures
Three different questions
When you create a commit, Git records an author and a committer. The author represents who originally wrote the change; the committer represents who recorded this version of it. They can differ, for example after cherry-picking. These names and emails are metadata, not proof that someone logged in. Authentication instead establishes the identity of a client to a service; authorization decides which operations that identity can perform. A cryptographic signature is a third mechanism: it can verify that a key signed particular content, subject to trust and verification rules. A verified signature does not prove the code is safe.
Inspect a synthetic commit
In the Chapter 12 disposable fixture, the author is Ada Learner and the committer is Sam Reviewer. The next commands inspect only the latest commit metadata. The synthetic addresses use the reserved .invalid domain. They are deliberately different from any hosted account. A local commit works without a GitHub account or network.
Privacy and diagnosis
Use an email you are authorized to use, such as the account-specific no-reply address provided by GitHub if desired. An email used in a public commit may remain in its history. Changing user.email affects future commits, not earlier ones. If a push is denied, check remote URL, account and permission rather than changing the author name. Do not rewrite shared history merely to fix attribution.
Practice example
Expected immediately after the first commit in the fixture (see its JSON evidence): Author: Ada Learner <ada@example.invalid>; Committer: Sam Reviewer <sam@example.invalid>. No hosted identity was checked.
Check your understanding
Classify author metadata, authentication, authorization and signature verification in the lab; explain why a local commit does not demonstrate a successful login.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Git Commit Identity, Authentication and Signatures — knowledge check
Choose safe authentication and identity practices in fictional scenarios.
What does user.email in a commit establish?
Can author and committer differ?
What does authorization decide?
Does a valid commit signature prove code is safe?
What does changing user.email do?