# Git History Visualization

## Overview

The Git History page provides a visual representation of a repository's commit history, including a branch graph and detailed commit information.

## How to Use

### Accessing History

1. Navigate to a **project workspace**
2. Select a **repository** from the dropdown
3. Click the **"History"** button on the repository card

Or:

1. Go to the **Repositories** page
2. Click **"History"** on any repository card

### History View Layout

```
┌─────────────────────────────────────────────┐
│  [Branch Selector ▼]  [Repository Name]      │
├─────────────────┬───────────────────────────┤
│  Commit List    │  Commit Details           │
│                 │                           │
│  ●─●─○─●        │  Commit: abc1234          │
│  │  └─○         │  Author: John Doe         │
│  │              │  Date: 2024-01-01         │
│  ●              │                           │
│  │              │  Message:                 │
│  ○              │  Fix bug in parser        │
│                 │                           │
│                 │  Stats:                   │
│                 │  +15 -3 lines             │
│                 │                           │
│                 │  Diff:                    │
│                 │  ```diff                  │
│                 │  + new line               │
│                 │  - old line               │
│                 │  ```                      │
└─────────────────┴───────────────────────────┘
```

### Commit Graph

The left panel shows:
- **Commit hashes** (abbreviated)
- **Branch/merge indicators** (lines connecting commits)
- **Commit messages** (first line)
- **Author** and **date**
- **Branch tags** (colored labels)

**Graph symbols:**
- `●` - Regular commit
- Branch lines show merge history
- Different colors indicate different branches

### Commit Details

Click any commit to see details:

**Metadata:**
- Full commit hash
- Author name and email
- Commit date and time
- Complete commit message

**Statistics:**
- Files changed
- Lines added (+)
- Lines removed (-)

**Diff:**
- Syntax-highlighted diff
- Added lines in green
- Removed lines in red
- Context lines for reference

### Branch Filtering

Use the **Branch Selector** to filter commits:
- Select **"All"** to see all branches
- Select a specific branch to see only that branch's history
- The graph updates to show only relevant commits

### Navigation

- **Click** a commit to view details
- **Scroll** the commit list to see older commits
- The view shows up to 10,000 commits (loads all at once)

## API Reference

### Endpoints

- `GET /projects/{id}/repositories/{id}/history` - Get commit history
- `GET /projects/{id}/repositories/{id}/commits/{hash}` - Get commit details

See [Repositories API](../api/repositories.md) for detailed endpoint documentation.

## Related Features

- [Git Repositories](repositories.md) - Manage repositories
- [Repository Workspace](workspace.md) - Browse files
