# How Can I View a Git Log of Just One User’s Commits?

To view a Git log of just one user's commits, you can use the `--author` flag with the `git log` command. This allows you to filter the commit history to show only those commits made by a specific author. Here’s how you can do it:

### Viewing Git Log of One User's Commits

1. **Open Your Terminal or Command Prompt:**
Start by opening your terminal or command prompt where your Git repository is located.
2. **Use `git log` with `-author` Option:**
Use the following command to view the commit history for a specific user:
    
    ```bash
    git log --author="John Doe"
    ```
    
    Replace `"John Doe"` with the name or email of the user whose commits you want to view.
    
    - **Example 1: Viewing by Name:**
        
        ```bash
        git log --author="John Doe"
        ```
        
    - **Example 2: Viewing by Email:**
        
        ```bash
        git log --author="john.doe@example.com"
        ```
        
3. **Additional Options:**
    - **Date Ranges:** You can also specify date ranges using `-since` and `-until` options to further filter the log output.
    - **Format:** Use `-pretty` to customize the log output format (`-pretty=oneline`, `-pretty=format:"%h %s"`, etc.).

### Example Usage

Let’s say you want to view the commit history of the user "John Doe":

```bash
git log --author="John Doe"
```

This command will list all commits made by "John Doe" in reverse chronological order (most recent first).

### Notes:

- **Exact Match:** The `-author` option matches the entire author string exactly. If you are unsure of the exact name or email format, you may need to check the commits or use partial matches cautiously.
- **Case Sensitivity:** The author matching is case-sensitive. Ensure the name or email is specified correctly.
- **Combining Filters:** You can combine `-author` with other `git log` options (like `-since`, `-until`, etc.) to further refine the commit history output.

By using `git log --author`, you can easily filter and view the commit history of a specific user within your Git repository. This is useful for reviewing contributions or investigating changes made by individual team members.