Provides a read-only way to sync with upstream repositories without altering local work.
Install
mkdir -p .claude/skills/git-sync-dtsong && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11306" && unzip -o skill.zip -d .claude/skills/git-sync-dtsong && rm skill.zipInstalls to .claude/skills/git-sync-dtsong
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when fetching and reviewing remote changes without modifying the local branch state.Key capabilities
- →Fetch remote git refs
- →Display upstream status
- →Compare ahead/behind commits
- →Preview changed files
How it works
It runs git fetch and git status commands to show the relationship between local and remote branches without altering the working tree.
Inputs & outputs
When to use git-sync
- →Check upstream changes
- →Review new commits on remote
- →Fetch remote refs
About this skill
Scope Constraints
- Read-only operation — fetches remote refs and displays status but does not modify local branches or working tree
- Runs
git fetch --prunewhich updates remote tracking refs and removes stale ones - Does not pull, merge, rebase, or push — use pull or push skills for those actions
Input Sanitization
- Remote name: only alphanumeric characters, hyphens, and underscores. Reject spaces,
.., shell metacharacters, or null bytes. - Flags: only
--allaccepted. Reject arbitrary strings.
/git-sync - Fetch and Show Remote Changes
Fetch the latest changes from remote without modifying your local branch. Shows what's new upstream.
Usage
/git-sync # Fetch all remotes and show status
/git-sync origin # Fetch specific remote
/git-sync --all # Fetch all remotes including tags
Workflow
Step 1: Fetch Remote Changes
# Fetch from all remotes with prune
git fetch --all --prune
Step 2: Show Current Status
# Get current branch
git branch --show-current
# Check remote tracking status
git status -sb
Step 3: Show Commits Ahead/Behind
# Get the remote tracking branch
REMOTE_BRANCH=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)
# If tracking branch exists, show difference
if [ -n "$REMOTE_BRANCH" ]; then
# Commits behind (on remote but not local)
git log --oneline HEAD..$REMOTE_BRANCH
# Commits ahead (on local but not remote)
git log --oneline $REMOTE_BRANCH..HEAD
fi
Step 4: Show Changed Files Preview
# Files that would change on pull
git diff --stat HEAD..@{u} 2>/dev/null
Output Format
Fetched from origin, upstream
Current branch: feat/dark-mode
Tracking: origin/feat/dark-mode
Behind by 3 commits:
abc1234 Fix theme persistence
def5678 Update color palette
ghi9012 Add system theme detection
Ahead by 1 commit:
xyz7890 WIP: toggle component
Files that would change on pull:
src/theme/colors.ts | 12 ++++++------
src/hooks/useTheme.ts | 45 +++++++++++++++++++++++++++++++++++++++++++++
Next steps:
/git-pull # Pull the changes
/git-stash # Stash local changes first
Edge Cases
No Remote Tracking Branch
Branch 'feat/local-only' has no upstream tracking branch.
To set tracking:
git branch --set-upstream-to=origin/feat/local-only
Or push with tracking:
git push -u origin feat/local-only
Already Up To Date
Current branch: main
Tracking: origin/main
Already up to date.
Network Error
Failed to fetch from origin: Could not resolve host: github.com
Check your network connection and try again.
Integration
- Run
/git-pullto apply the fetched changes - Run
/git-stashif you have uncommitted changes to save first - Run
/git-branchesto see status of all branches
When not to use it
- →When you need to modify local branches
- →When you need to pull, merge, or rebase
Prerequisites
Limitations
- →Read-only operation
- →Does not pull, merge, rebase, or push
How it compares
It provides a read-only view of upstream changes, unlike pull or merge commands that modify local state.
Compared to similar skills
git-sync side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| git-sync (this skill) | 0 | 2mo | Review | Beginner |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| openspec-onboard | 10 | 6mo | Review | Beginner |
| codex-cli-bridge | 9 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by dtsong
View all by dtsong →You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
openspec-onboard
studyzy
Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
codex-cli-bridge
alirezarezvani
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
skill-sync
KyleKing
Syncs Claude Skills with other AI coding tools like Cursor, Copilot, and Codeium by creating cross-references and shared knowledge bases. Invoke when user wants to leverage skills across multiple tools or create unified AI context.
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.