sync

Synchronize a local git branch with origin/main via fetch, merge, commit, and push.

Updated Nov 9, 2025
One-click install
npx skills add https://github.com/YoniChechik/claude-code-config --skill sync-yonichechik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync
Source: https://github.com/YoniChechik/claude-code-config/tree/main/skills/sync
Command: npx skills add https://github.com/YoniChechik/claude-code-config --skill sync-yonichechik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates keeping a local git branch synchronized with origin/main by merging, committing, and pushing to remote, preventing divergence and stale work.

Core Features & Use Cases

  • Automated synchronization: fetches origin/main, merges, resolves simple conflicts, and preserves local changes.
  • Deterministic commits: generates clear commit messages and pushes updates to remote so teams stay aligned.
  • Use Case: In a collaborative project with multiple contributors, keep your feature branch up-to-date before creating a pull request to origin/main.

Quick Start

Execute a synchronization cycle with these commands: git fetch origin git merge origin/main

Resolve conflicts if any

git add -A git commit -m "<your generated message>" git push

Frequently Asked Questions about sync

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

FAQPage Schema
How do I keep my local git branch synchronized with origin main?

To keep your local git branch synchronized with origin main, you need to fetch remote updates, merge origin/main into your branch, resolve any conflicts, commit the changes, and push to remote. This prevents branch divergence and stale work.

What is the best way to resolve git conflicts before merging origin main?

Resolving git conflicts during an origin main merge requires fetching and merging remote changes, manually resolving simple conflicts that arise, staging all files with git add, and generating a commit to push the synchronized state back to remote.

How do I automate git fetch, merge, and push for collaborative development?

Automating git fetch, merge, and push for collaborative development involves running a deterministic workflow that fetches origin, merges origin/main, resolves simple conflicts, generates clear commit messages, and pushes updates so teams stay aligned.

Why does my feature branch diverge from origin main and how do I fix it?

Your feature branch diverges from origin main when local and remote histories split. Fix divergence by fetching origin, merging origin/main into your local branch, resolving conflicts, committing, and pushing to ensure local HEAD is ahead of or equal to origin.

Can I use this sync workflow to prepare a feature branch before a pull request?

Yes, you can use this sync workflow to prepare a feature branch before a pull request. It fetches and merges origin/main, resolves simple conflicts, and pushes updates to ensure your branch is current and non-divergent before submitting.

Does branch synchronization work if my local HEAD is behind origin main?

Branch synchronization works when your local HEAD is behind origin main by fetching the latest remote state, merging origin/main into your current branch, and pushing the updated commit history to ensure local and remote repositories match.