> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vibehub.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# vibe merge

> Merge a branch into the current branch

## Usage

```bash theme={null}
vibe merge <branch> [options]
```

## Description

Merge the specified branch into the current branch. This combines the commit history from both branches.

## Arguments

<ParamField query="branch" type="string" required>
  Branch to merge into the current branch.
</ParamField>

## Options

<ParamField query="-m, --message" type="string">
  Custom merge commit message.
</ParamField>

<ParamField query="--no-ff" type="boolean">
  Create a merge commit even if fast-forward is possible.
</ParamField>

<ParamField query="--dry-run" type="boolean">
  Show what would be merged without actually merging.
</ParamField>

## Examples

### Basic Merge

```bash theme={null}
vibe merge feature/user-auth
```

Output:

```
Merging 'feature/user-auth' into 'main'...
  3 commit(s) to merge
Fast-forward merge completed.
  main is now at commit abc1234
```

### Merge with Custom Message

```bash theme={null}
vibe merge feature/payments -m "Add payment processing feature"
```

### Preview Merge (Dry Run)

```bash theme={null}
vibe merge feature/api --dry-run
```

Output:

```
[Dry run] Would merge:
  Source: feature/api (commit def5678)
  Target: main (commit abc1234)
  Commits ahead: 5
  Commits behind: 0

  Merge type: Fast-forward possible
```

### Force Merge Commit

```bash theme={null}
vibe merge feature/ui --no-ff
```

Creates a merge commit even when fast-forward is possible, preserving branch history.

## Merge Types

### Fast-Forward Merge

When the target branch has no new commits since the source branched off, Git can simply move the pointer forward.

```
Before:
main:     A---B
               \
feature:        C---D

After (fast-forward):
main:     A---B---C---D
```

### Merge Commit

When both branches have diverged, a merge commit is created.

```
Before:
main:     A---B---E
               \
feature:        C---D

After (merge commit):
main:     A---B---E---M
               \     /
feature:        C---D
```

## Workflow Example

```bash theme={null}
# Start on main branch
vibe checkout main

# Make sure you have latest changes
vibe pull

# Merge the feature branch
vibe merge feature/new-dashboard

# Push the merged changes
vibe push
```

## Error Messages

### Cannot Merge into Itself

```
Cannot merge branch 'main' into itself
```

**Solution:** Switch to the target branch first, then merge the source branch.

### Already Up to Date

```
Already up to date.
```

This means there are no new commits to merge.

### Branch Not Found

```
Branch 'feature' not found
```

**Solution:** Check the branch name with `vibe branch` or fetch latest with `vibe fetch`.

### Merge Failed

```
Merge failed: Conflicts detected
```

**Solution:** Resolve conflicts manually in the web interface or use force options.

## Related Commands

* [vibe branch](/cli/commands/branch) - List and manage branches
* [vibe checkout](/cli/commands/checkout) - Switch branches
* [vibe diff](/cli/commands/diff) - Compare branches before merging
