| name | refresh-fork |
| description | Refresh fork to match upstream, preparing for new contributions. |
| disable-model-invocation | true |
| context | fork |
| agent | general-purpose |
Refresh fork to match upstream, preparing for new contributions.
Process
-
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>