---
tags:
  - git
  - configuration
  - linux
  - guide
  - version-control
---

# Git Configuration Guide

After installing Git, the first step is to introduce yourself to the version control system. These settings are embedded into every commit you make.

## 1. Prerequisites

Ensure Git is installed on your system.

*   **Reference:** [[Post-Install-Config|Post-Install Linux Configuration]]

## 2. Identity Setup

Git needs to know who you are to attribute changes to you.

1.  **Set your Name:**
    ```bash
    git config --global user.name "Your Name"
    ```

2.  **Set your Email:**
    *   *Note: This should match the email used for your GitHub/GitLab account.*
    ```bash
    git config --global user.email "your.email@example.com"
    ```

## 3. Default Branch Configuration

Historically, Git used `master` as the default branch name. Modern best practices and platforms like GitHub now use `main`.

*   **Set default branch to `main`:**
    ```bash
    git config --global init.defaultBranch main
    ```

## 4. Verification

To confirm your settings are applied correctly:

1.  Run the list command:
    ```bash
    git config --list
    ```
2.  **Expected Output:**
    ```text
    user.name=Your Name
    user.email=your.email@example.com
    init.defaultbranch=main
    ```