git-sync-source

Clone or fast-forward a primary Git repository checkout to match its default branch.

2|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/witwave-ai/witwave --skill git-sync-source-witwave-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-sync-source
Source: https://github.com/witwave-ai/witwave/tree/main/.agents/self/iris/.claude/skills/git-sync-source
Command: npx skills add https://github.com/witwave-ai/witwave --skill git-sync-source-witwave-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Agents working on a source tree need a local checkout that is current with the remote default branch before reading or modifying code. This Skill standardizes cloning on first run and safely refreshing the checkout on later runs, avoiding stale-code mistakes and destructive git operations. ## Core Features & Use Cases - Idempotent clone-or-refresh: Detects whether the checkout exists and either clones into the mounted volume or runs fetch plus fast-forward-only pull. - Safe failure handling: Refuses to merge diverged branches, never force-resets, and surfaces auth or network errors to the user instead of retrying blindly. - Agent-agnostic configuration: Reads the repo URL, checkout path, and default branch from the agent's CLAUDE.md, so one Skill serves an entire agent family. - Use Case: Before starting a code-modification task, an agent runs this Skill to guarantee its workspace source volume matches the remote main branch, then pins its git identity for subsequent commits. ## Quick Start Ask the agent to sync the source by saying "pull latest" or "refresh the repo" before starting any code-modification task.

Frequently Asked Questions about git-sync-source

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

FAQPage Schema
How do I clone a git repository into an existing non-empty directory?▼

Change into the target directory and run git clone with a dot as the destination, which clones into the current directory rather than a new subdirectory. If stray files like lost+found block the clone, list them and confirm with the user before deleting anything.

How do I update a git checkout without merging diverged branches?▼

Run git fetch origin followed by git pull --ff-only origin <branch>. The --ff-only flag refuses to merge when local and remote have diverged, forcing you to stop and decide how to reconcile instead of silently merging.

How do I pass GitHub credentials to git clone without exposing tokens?▼

Embed environment variable references like ${GITHUB_USER} and ${GITHUB_TOKEN} in the HTTPS clone URL so the shell expands them at runtime from the container environment. Never echo the values or hardcode them into files.

Why does git pull --ff-only fail and what should I do?▼

A fast-forward-only pull fails when the local branch has unpushed commits or the remote was force-pushed, causing divergence. Report the local versus remote HEAD state and ask the user how to proceed rather than running git reset --hard or a merge pull.

Can this Skill commit or push changes to the repository?▼

No, committing and pushing are explicitly out of scope. The Skill is read-only against the remote and only handles cloning and refreshing the checkout; use a separate workflow for commits, pushes, and branch operations.