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:- No merge commit needed
- History stays linear
- Cleanest merge type
Merge Commit
When both branches have new commits:- 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:| Element | Description |
|---|---|
| Source branch | The branch with changes you’re merging |
| Target branch | The branch receiving the changes |
| Merge type | Fast-forward or merge commit |
| Commit count | Number of commits being merged |
| Merge message | Editable message for merge commits |
Protected Branch Warnings
Protected branches may have additional requirements like:- Code review approval
- Passing tests
- Admin override
After the Merge
Once merged successfully:- The target branch now includes all changes from the source
- You’ll see a success confirmation with the merge commit ID (if applicable)
- The source branch still exists (you can delete it if done)
Cleaning Up
After merging a feature branch, consider deleting it:- Go to the branch selector
- Find your merged branch
- Click the delete icon
- Confirm deletion
Handling Diverged Branches
If branches have diverged significantly:- Option A: Merge anyway and create a merge commit
- Option B: Update your feature branch first by merging main into it
- Option C: Use the CLI for more advanced conflict resolution
Merge Best Practices
Keep branches short-lived
Keep branches short-lived
Merge feature branches quickly to avoid large divergences.
Update before merging
Update before merging
If main has changed, consider updating your branch first to catch conflicts early.
Review before merging
Review before merging
Always compare branches before merging to understand what’s changing.
Write clear merge messages
Write clear merge messages
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:- Pull the branches locally
- Resolve conflicts in your editor
- Push the resolved version