2 Configuring Git

Git requires some configuration to work. You must tell Git your name and your email address since there is no central repository to keep track of that information. Git uses both to calculate the commit ID—an SHA-1[11] hash—that identifies each commit.

The first two commands on the next page use --global to specify that they are configuration values for every repository you interact with on this machine. The configuration file is stored in ~/.gitconfig. You can edit the file directly in addition to using the git config command.

You can set every setting on a global or per-repository basis. By leaving --global out of the command, the settings will be stored in the repository’s .git/config file.

You might want ...

Get Pragmatic Guide to Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.