sync

Syncs a session branch with its upstream via fetch, rebase, and push.

Updated Sep 3, 2026
One-click install
npx skills add https://github.com/az0512124155azz-sys/CodeForge --skill sync-az0512124155azz-sys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync
Source: https://github.com/az0512124155azz-sys/CodeForge/tree/main/src/vs/sessions/skills/sync
Command: npx skills add https://github.com/az0512124155azz-sys/CodeForge --skill sync-az0512124155azz-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping a local session branch aligned with its remote upstream involves several error-prone Git steps: fetching, checking ahead/behind counts, rebasing, resolving conflicts, and pushing. This Skill automates that entire workflow safely, including publishing branches that have no upstream yet. ## Core Features & Use Cases - Upstream Sync: Fetches the remote, checks ahead/behind counts, rebases onto the upstream tracking branch, and pushes local commits. - Branch Publishing: Publishes a branch with no upstream using git push -u, prompting you to choose a remote when multiple exist. - Safe Conflict Handling: Guides rebase conflict resolution, supports aborting the rebase, and never force-pushes or skips hooks without explicit approval. - Use Case: You finished a feature on a session branch and want to pull the latest team changes and push your commits. The Skill commits pending changes, rebases onto upstream, pushes, and verifies the branch is fully in sync. ## Quick Start Ask the assistant to sync my current session branch with its upstream remote.

Frequently Asked Questions about sync

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

FAQPage Schema
How do I sync my local branch with the remote upstream?

Fetch the remote first, then check ahead/behind counts with git rev-list --left-right --count HEAD...@{u}. If behind, rebase onto the upstream tracking branch with git rebase @{u}, then push any local commits after the rebase succeeds.

How do I publish a Git branch that has no upstream?

Run git push -u <remote> HEAD to publish the current branch and set its upstream in one step. If multiple remotes exist, choose which remote to publish to before running the command.

What should I do when a rebase hits merge conflicts?

Resolve conflicts by preserving the intent of both sides, stage the resolved files with git add, then run git rebase --continue. If resolution is unclear or you want to stop, use git rebase --abort to return to the pre-rebase state.

Why is my push rejected after rebasing onto upstream?

A rebase rewrites local commit history, so the remote rejects a normal push as non-fast-forward. Force-pushing rewrites remote history and should only be done with explicit approval, never by default.

Can I sync a branch with uncommitted changes?

Uncommitted changes should be committed before syncing to avoid conflicts during the rebase. Commit pending work first, then fetch, rebase, and push as usual.