A1.1 Setup and Initialization

Before you start working with Git, you have to configure it. Before you can start working on a new project, you have to initialize it. This section covers commands related to the initial configuration and setup of Git.

Configure Global Username/Email

 
​prompt> git config --global user.name "Your Name"
 
​prompt> git config --global user.email "you@example.com"

Configure Username/Email for a Specific Repository

Note: You can set your username and email address on a per-repository basis. This allows you to use a different name and/or email address for different projects.

 
​prompt> cd /path/to/repo
 
​prompt> git config user.name "Your Name"
 
​prompt> git config ...

Get Pragmatic Version Control Using 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.