/git-tools:refresh-forkfrom git-tools
Resets a forked repository to match its upstream default branch, discarding local changes and force-pushing to origin. Useful before starting new contributions.
Ships in git-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Refresh fork to match upstream, preparing for new contributions.
Check upstream exists
git remote get-url upstream
If fails: stop with error "No upstream remote configured. This doesn't look like a fork."
Determine default branch
git remote show upstream | grep 'HEAD branch' | awk '{print $NF}'
Fallback: try main, then master
Discard local state
git checkout <default-branch>
git reset --hard
git clean --force -d
Sync with upstream
git fetch upstream
git reset --hard upstream/<default-branch>
Push to origin
git push origin <default-branch> --force
Confirm
Report: synced to which commit (short sha + message), now on <default-branch>
What SKILL.md sets; muted values are Claude Code's defaults
general-purpose), in the background2 skills in this plugin
npx claudepluginhub lexfrei/ccc --plugin git-toolsOther plugins' skills for the same job