Skip to main content

Overview

Merging combines the changes from one branch into another. This is how you bring feature work back into your main branch.

Merge Types

VibeHub supports two types of merges:

Fast-Forward Merge

When the target branch hasn’t changed since you branched off:
Before:
main:     A---B
               \
feature:        C---D

After:
main:     A---B---C---D
Characteristics:
  • No merge commit needed
  • History stays linear
  • Cleanest merge type

Merge Commit

When both branches have new commits:
Before:
main:     A---B---E
               \
feature:        C---D

After:
main:     A---B---E---M
               \     /
feature:        C---D
Characteristics:
  • Creates a merge commit (M)
  • Preserves both histories
  • Shows where branches combined

Performing a Merge

1

Compare Branches

First, compare your branches to see what will be merged
2

Click Merge

If your source branch is ahead of the target, click the Merge button
3

Review Merge Dialog

The merge dialog shows:
  • Source and target branches
  • Merge type (fast-forward or merge commit)
  • Number of commits being merged
4

Add Merge Message (if needed)

For merge commits, you can customize the commit message
5

Confirm

Click Merge to complete the operation

The Merge Dialog

When you initiate a merge, you’ll see:
ElementDescription
Source branchThe branch with changes you’re merging
Target branchThe branch receiving the changes
Merge typeFast-forward or merge commit
Commit countNumber of commits being merged
Merge messageEditable message for merge commits

Protected Branch Warnings

If you’re merging into a protected branch, you’ll see a warning. Make sure you have the necessary permissions.
Protected branches may have additional requirements like:
  • Code review approval
  • Passing tests
  • Admin override

After the Merge

Once merged successfully:
  1. The target branch now includes all changes from the source
  2. You’ll see a success confirmation with the merge commit ID (if applicable)
  3. The source branch still exists (you can delete it if done)

Cleaning Up

After merging a feature branch, consider deleting it:
  1. Go to the branch selector
  2. Find your merged branch
  3. Click the delete icon
  4. Confirm deletion
Deleting merged branches keeps your branch list clean. The commits are preserved in the target branch.

Handling Diverged Branches

If branches have diverged significantly:
  1. Option A: Merge anyway and create a merge commit
  2. Option B: Update your feature branch first by merging main into it
  3. Option C: Use the CLI for more advanced conflict resolution

Merge Best Practices

Merge feature branches quickly to avoid large divergences.
If main has changed, consider updating your branch first to catch conflicts early.
Always compare branches before merging to understand what’s changing.
For merge commits, explain what feature or fix is being integrated.

Troubleshooting

Can’t Merge

If the merge button is disabled:
  • You might not have write access
  • The branches might be identical
  • The source might not be ahead of the target

Merge Conflicts

VibeHub will warn you if conflicts are detected. For complex conflicts, you may need to:
  1. Pull the branches locally
  2. Resolve conflicts in your editor
  3. Push the resolved version

Next Steps