npx skills add ...
npx skills add brave/brave-core --skill force-push-downstream
npx skills add brave/brave-core --skill force-push-downstream
'Force-push a branch and all its downstream branches to origin. Auto-detects the downstream tree and skips branches already up-to-date. Triggers on: force push downstream, push chain, push all branches.'
Force-push a branch and all its downstream branches to their respective remotes. Skips branches whose local and remote tips already match.
starting-branch (optional) — The branch to start from. Defaults to the
current branch if not specified.Examples:
/force-push-downstream — push current branch + all downstream/force-push-downstream candle-service-webui — push from that branch downgit branch --show-currentgit status --shortIf an argument was provided, use it as the starting branch. Otherwise use the current branch.
Run the detect-chain script (shared with rebase-downstream) to find all downstream branches:
The push list is: the starting branch itself, followed by every downstream branch in tree order (from detect-chain output).
Display the branches that will be pushed:
For each branch, check if it is already up-to-date with origin:
If local_sha == remote_sha, mark as (up-to-date, will skip). If the remote
branch doesn't exist, mark as (new, will push). Otherwise mark as
(diverged, will force-push).
Ask the user to confirm before pushing.
For each branch in the push list:
Skip if up-to-date: If local SHA matches origin SHA, print skip message and move on.
Force push:
Use --force-with-lease for safety — it fails if someone else pushed to the
remote since our last fetch, preventing accidental overwrites of others'
work.
If the remote branch doesn't exist (first push), use:
Report result: Print success/failure for each branch.
After all pushes complete, show a summary:
--force-with-lease instead of --force for safety