Claude Code Plugins

Community-maintained marketplace

Feedback

Update from Main

@zmchenry/dotfiles
0
0

Updates the current branch with the latest changes from origin/main using rebase. Use when the user asks to update, sync, or rebase their branch with main/master.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name Update from Main
description Updates the current branch with the latest changes from origin/main using rebase. Use when the user asks to update, sync, or rebase their branch with main/master.

Update from Main

This skill helps update the current branch with the latest changes from origin/main using git rebase.

Quick Start

When the user requests to update their branch with main:

  1. Check the current branch name
  2. Ensure working directory is clean (no uncommitted changes)
  3. Fetch latest changes from origin
  4. Rebase current branch onto origin/main
  5. Handle any conflicts that arise

Instructions

Step 1: Check current state

# Get current branch name
git branch --show-current

# Check for uncommitted changes
git status

If there are uncommitted changes, ask the user if they want to:

  • Commit them first
  • Stash them
  • Abort the operation

Step 2: Fetch latest changes

# Fetch all latest changes from origin
git fetch origin

Step 3: Rebase onto origin/main

# Rebase current branch onto origin/main
git rebase origin/main

Step 4: Handle conflicts

If conflicts occur during rebase:

  1. Show the conflicting files:
git status
  1. Inform the user about the conflicts and list the files

  2. Explain that they need to:

    • Resolve conflicts manually
    • Run git add <file> for each resolved file
    • Run git rebase --continue
    • Or run git rebase --abort to cancel
  3. Offer to help resolve conflicts if the user requests it

Step 5: Confirm success

After successful rebase:

# Show the updated status
git status

# Show recent commits to verify
git log --oneline -5

Inform the user that:

  • The branch has been successfully updated with changes from origin/main
  • If the branch was previously pushed, they may need to force push: git push --force-with-lease

Important Notes

  • Always check for uncommitted changes before starting
  • Use git rebase --abort if something goes wrong
  • Prefer git push --force-with-lease over git push --force for safety
  • If the user prefers merge over rebase, use git merge origin/main instead

Alternative: Merge instead of Rebase

If the user explicitly prefers merge or if rebase fails repeatedly:

git fetch origin
git merge origin/main

This creates a merge commit instead of rewriting history.

Common Issues

  • "cannot rebase with uncommitted changes": Stash or commit changes first
  • Conflicts during rebase: Help user resolve them or abort and try merge
  • Already up to date: Inform user no changes were needed