Skip to main content

Usage

vibe diff [branch1]..[branch2]

Description

Compare two branches and show how they differ. Displays commits ahead/behind and the common ancestor.

Arguments

branch1..branch2
string
Branches to compare using .. syntax.
  • main..feature - Compare main with feature
  • ..feature - Compare current branch with feature
  • main.. - Compare main with current branch
  • (no args) - Compare current branch with default branch

Examples

Compare Two Branches

vibe diff main..feature/api
Output:
Comparing main..feature/api

  main:
    Head commit: abc1234
  feature/api:
    Head commit: def5678

  feature/api is 3 commit(s) ahead of main
  feature/api is 1 commit(s) behind main

  Common ancestor: commit xyz9999

Compare Current Branch with Default

vibe diff
Compares your current branch with the default branch (usually main).

Compare with Current Branch

vibe diff feature/ui..
Compares feature/ui with your current branch.

Check if Branches are Identical

vibe diff develop..staging
Output:
Comparing develop..staging

  develop:
    Head commit: abc1234
  staging:
    Head commit: abc1234

Branches are identical

Understanding the Output

Ahead/Behind

  • Ahead: Commits in branch1 that are not in branch2
  • Behind: Commits in branch2 that are not in branch1

Common Ancestor

The most recent commit that both branches share. This is where the branches diverged.

Workflow Examples

Before Merging

# Check what you're about to merge
vibe diff main..feature/payments

# If looks good, proceed
vibe checkout main
vibe merge feature/payments

Check for Updates

# Fetch latest
vibe fetch

# See if remote has new commits
vibe diff main..origin/main

Review Feature Branch

# How far ahead is the feature?
vibe diff main..feature/redesign

Error Messages

Same Branch

No difference - comparing same branch
Solution: Compare two different branches.

Branch Not Found

Branch 'feature' not found
Solution: Check branch name with vibe branch or fetch with vibe fetch.