Update from Main

Rebase the current branch onto origin/main after fetching origin.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/zmchenry/dotfiles --skill update-from-main
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Update from Main
Source: https://github.com/zmchenry/dotfiles/tree/main/.claude/skills/update-from-main
Command: npx skills add https://github.com/zmchenry/dotfiles --skill update-from-main

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers keep their feature branches up-to-date with the latest changes from origin/main by performing a git rebase, reducing conflicts and drift between local work and the main branch.

Core Features & Use Cases

  • Rebase onto origin/main: Integrates upstream changes into the current branch without creating merge commits.
  • Conflict guidance: Detects conflicts and guides the user through resolution or aborts if needed.
  • Safe workflow: Verifies a clean working tree, fetches origin, and presents clear next steps for completion.

Quick Start

Check the current branch name Ensure the working directory is clean (no uncommitted changes) Fetch latest changes from origin Rebase current branch onto origin/main If conflicts occur, resolve them or abort and retry

Frequently Asked Questions about Update from Main

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rebase my current git branch onto origin/main?

Rebasing onto origin/main integrates upstream changes without creating merge commits. The workflow verifies a clean working tree, fetches origin, and executes git rebase to sync your local feature branch.

What is the best way to sync a feature branch with the latest upstream changes?

Syncing a feature branch with upstream changes is best done via a rebase onto origin/main. This approach replays your local commits on top of the latest main branch updates, reducing drift and avoiding extra merge commits.

How does git rebase handle conflicts when updating from main?

Git rebase detects conflicts during the update from main and guides you through resolution. If conflicts occur, you can resolve them step-by-step or abort the rebase and retry safely.

Do I need a clean working directory before rebasing onto origin/main?

Yes, you need a clean working directory before rebasing onto origin/main. The safe workflow checks for uncommitted changes and fetches origin only after verifying the working tree is clean to prevent data loss.

Why should I use rebase instead of merge to update my local branch?

Using rebase instead of merge to update your local branch keeps your commit history linear by avoiding merge commits. Rebasing onto origin/main replays your local changes directly on top of upstream updates, reducing branch drift.

What should I do if my git rebase from origin/main fails due to conflicts?

If your git rebase from origin/main fails due to conflicts, the workflow guides you through conflict resolution. You can manually fix the conflicting files and continue, or abort the rebase to return to your original state.