Skip to main content

Usage

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

Output:

Compare Current Branch with Default

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

Compare with Current Branch

Compares feature/ui with your current branch.

Check if Branches are Identical

Output:

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 for Updates

Review Feature Branch

Error Messages

Same Branch

Solution: Compare two different branches.

Branch Not Found

Solution: Check branch name with vibe branch or fetch with vibe fetch.