Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
brave avatar

Force Push Downstream

  • 7 installs
  • 3.5k repo stars
  • Updated August 5, 2026
  • brave/brave-core

force-push-downstream is a Claude Code skill that force-pushes a branch and all its downstream branches to origin, auto-detecting the chain and skipping up-to-date branches.

About

This skill force-pushes a branch and all of its downstream branches to their remotes. A developer uses it when managing a stacked chain of dependent branches that need pushing together after a rebase. It auto-detects the downstream tree, skips branches whose local and remote tips already match, uses --force-with-lease for safety, and asks for confirmation before pushing.

  • Force-pushes a branch and all its downstream branches to origin in tree order
  • Auto-detects the downstream chain and skips branches already up-to-date with remote
  • Uses git push --force-with-lease for safety and returns to the original branch

Force Push Downstream by the numbers

  • 7 all-time installs (skills.sh)
  • Ranked #457 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

force-push-downstream capabilities & compatibility

Capabilities
stacked branches · force push · git workflow
Works with
github
Use cases
devops
From the docs

What force-push-downstream says it does

Force-push a branch and all its downstream branches to their respective remotes. Skips branches whose local and remote tips already match.
SKILL.md
Use `--force-with-lease` for safety — it fails if someone else pushed to the remote since our last fetch
SKILL.md
Do NOT push** without user confirmation
SKILL.md
npx skills add https://github.com/brave/brave-core --skill force-push-downstream

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs7
repo stars3.5k
Last updatedAugust 5, 2026
Repositorybrave/brave-core

What it does

Force-push a branch and its downstream chain to origin in tree order, skipping up-to-date branches with force-with-lease.

Who is it for?

Pushing a stacked chain of dependent branches together after a rebase

Skip if: A single independent branch with no downstream chain

When should I use this skill?

On triggers force push downstream, push chain, push all branches

What you get

The branch and its downstream chain force-pushed in tree order with force-with-lease, skipping up-to-date branches.

  • force-pushed downstream branch chain

By the numbers

  • 6-step push workflow

Files

SKILL.mdMarkdownGitHub ↗

Force Push Downstream

Force-push a branch and all its downstream branches to their respective remotes. Skips branches whose local and remote tips already match.

Arguments

  • `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 down

Current State

  • Branch: !git branch --show-current
  • Status: !git status --short

Steps

1. Determine starting branch

If an argument was provided, use it as the starting branch. Otherwise use the current branch.

git branch --show-current

2. Detect downstream chain

Run the detect-chain script (shared with rebase-downstream) to find all downstream branches:

bash .claude/skills/rebase-downstream/detect-chain.sh <starting-branch>

3. Build push list

The push list is: the starting branch itself, followed by every downstream branch in tree order (from detect-chain output).

4. Show plan and confirm

Display the branches that will be pushed:

Force push plan:
  candle-service-background-webcontents
    → background-webcontents-timer
      → candle-service-webui
        → candle-service-model-loading
          → brave-history-embeddings
          → local-ai-internals

For each branch, check if it is already up-to-date with origin:

# Get local and remote SHAs
local_sha=$(git rev-parse <branch>)
remote_sha=$(git rev-parse origin/<branch> 2>/dev/null || echo "none")

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.

5. Push each branch

For each branch in the push list:

1. Skip if up-to-date: If local SHA matches origin SHA, print skip message and move on.

2. Force push:

   git push --force-with-lease origin <branch>

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.

3. If the remote branch doesn't exist (first push), use:

   git push -u origin <branch>

4. Report result: Print success/failure for each branch.

6. Report summary

After all pushes complete, show a summary:

Force push results:
  ✓ candle-service-background-webcontents (pushed)
  - background-webcontents-timer (skipped, up-to-date)
  ✓ candle-service-webui (pushed)
  ✓ candle-service-model-loading (pushed)
  ✓ brave-history-embeddings (pushed, new)
  ✗ local-ai-internals (failed: ...)

Important

  • Always use `--force-with-lease` instead of --force for safety
  • Do NOT push without user confirmation
  • Skip branches that are already up-to-date (local == remote SHA)
  • If any push fails, report it but continue with remaining branches
  • Return to the original branch at the end

Related skills

FAQ

Why force-with-lease?

It fails if someone else pushed to the remote since the last fetch, preventing accidental overwrites of others' work.

Does it push branches already up-to-date?

No. If a branch's local SHA matches its origin SHA it is marked up-to-date and skipped.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.