Theory

Updated

October 30, 2026

Theory: Identity and Config are Data, Not Login

Git does not have accounts. It has key-value config and author strings baked into commits. A forge later matches those strings to a user.

Invariants

  1. Config is three layers: system (/etc/gitconfig), global (~/.gitconfig), local (.git/config). Later overrides earlier.
  2. user.name and user.email are copied into every commit object. Changing config does not rewrite old commits.
  3. Authentication to a remote (SSH key or HTTPS token) is separate from commit identity.
  4. init.defaultBranch only affects new repositories.
  /etc/gitconfig          machine
  ~/.gitconfig            you
  .git/config             this repo     ← wins

  user.email ──► commit.author     (history)
  SSH key    ──► git@host          (transport)

Why layers

One person, two emails (home and work) is a local or includeIf problem, not a second Git install. One laptop, several forges, is several keys in ~/.ssh/config, not several user.names.

What can break

  • Commits with $USER@$HOSTNAME because identity was never set (user.useConfigOnly refuses that).
  • Pushing with HTTPS using an account password; most forges want a token.
  • Setting core.autocrlf on Linux and fighting LF files.
  • Assuming core.editor is optional and then hanging in vim on git commit with no -m.

How to read this chapter

Install is PATH and version. Layers are which file won (--show-origin). Identity is what history will say. SSH vs HTTPS is how a remote will know you. Editor, aliases, and updates are the Linux daily driver.