sync

Syncs a session branch with its upstream or publishes it to a remote.

Updated Apr 28, 2026
Ready to run
npx skills add https://github.com/CokiStudios/cokistudios.github.io --skill sync-cokistudios
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: sync
Source: https://github.com/CokiStudios/cokistudios.github.io/tree/main/vscode-src/src/vs/sessions/skills/sync
Command: npx skills add https://github.com/CokiStudios/cokistudios.github.io --skill sync-cokistudios

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping a working branch aligned with its upstream remote involves several error-prone Git steps: fetching, checking ahead/behind counts, rebasing, resolving conflicts, and pushing. This Skill automates that entire flow safely, including publishing branches that have no upstream yet. ## Core Features & Use Cases - Upstream Synchronization: Fetches the remote, checks ahead/behind status, rebases onto the upstream tracking branch, and pushes local commits. - Branch Publishing: Detects branches without an upstream and publishes them with git push -u, asking which remote to use when multiple remotes exist. - Safety Guardrails: Never force-pushes, never skips pre-push hooks, and asks the user before rewriting commits or when conflict resolution is unclear. - Use Case: You finished a feature on a session branch and want the latest main-branch changes incorporated. The Skill commits pending work via the commit skill, rebases onto upstream, resolves conflicts with your guidance, pushes, and verifies the branch is fully in sync. ## Quick Start Ask the assistant to sync my current branch with its upstream and push any local commits.

Frequently Asked Questions about sync

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

FAQPage Schema
How do I sync my current Git branch with upstream?▼

Fetch the upstream remote, check ahead/behind counts with git rev-list --left-right --count HEAD...@{u}, rebase onto the upstream tracking branch if behind, then push local commits. This Skill automates that full sequence and verifies the result.

How to publish a Git branch that has no upstream?▼

Run git push -u <remote> HEAD to publish the branch and set its upstream in one step. If the repository has multiple remotes, the Skill asks which remote to use before publishing.

What happens if a rebase causes merge conflicts during sync?▼

Conflicts are resolved by preserving the intent of both sides, then staging the resolved files and running git rebase --continue. If resolution is unclear, the Skill asks the user, and it can abort the rebase with git rebase --abort on request.

Does this sync workflow ever force-push?▼

No. Force-pushing with --force or --force-with-lease is never done without explicit user approval. If a push is rejected because a rebase rewrote history, the Skill explains the situation and asks before force-pushing.

What if I have uncommitted changes before syncing?▼

Uncommitted changes are committed first using the commit skill before the sync workflow continues. This prevents rebase failures and keeps the working tree clean throughout the process.