Skip to content

Branch and Merge

Multi-branch data workflows with Blacklake.

Overview

This tutorial demonstrates how to use branching and merging in Blacklake for collaborative data workflows.

Branching Workflow

1. Create Feature Branch

# Create and switch to feature branch
blacklake branch feature/new-analysis
blacklake checkout feature/new-analysis

Expected Output:

Switched to branch 'feature/new-analysis'

2. Add Data to Branch

# Add analysis data
blacklake meta add analysis-results.csv \
  --title "Sales Analysis Results" \
  --creator "Analytics Team" \
  --description "Statistical analysis of sales data"

blacklake add analysis-results.csv
blacklake commit -m "Add sales analysis results"

3. Merge Back to Main

# Switch to main branch
blacklake checkout main

# Merge feature branch
blacklake merge feature/new-analysis

Expected Output:

✓ Merged feature/new-analysis into main

Collaborative Workflow

1. Clone Repository

# Clone remote repository
blacklake clone https://github.com/company/data-repo.git
cd data-repo

2. Create Personal Branch

# Create personal branch
blacklake branch user/john-doe
blacklake checkout user/john-doe

3. Make Changes

# Add your data
blacklake meta add my-analysis.csv \
  --title "My Analysis" \
  --creator "John Doe" \
  --email "john@company.com"

blacklake add my-analysis.csv
blacklake commit -m "Add my analysis"

4. Push Changes

# Push to remote
blacklake push origin user/john-doe

Advanced Branching

Branch Management

# List branches
blacklake branch

# List remote branches
blacklake branch -r

# Delete branch
blacklake branch -d feature/old-analysis

Branch Comparison

# Show differences between branches
blacklake diff main feature/new-analysis

# Show commit history
blacklake log --graph --oneline

Next Steps