force-push-downstream

Force-push a branch and its downstream branches to origin with --force-with-lease.

3.5k|1.4k|Updated Nov 10, 2017
One-click install
npx skills add https://github.com/brave/brave-core --skill force-push-downstream
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: force-push-downstream
Source: https://github.com/brave/brave-core/tree/main/.claude/skills/force-push-downstream
Command: npx skills add https://github.com/brave/brave-core --skill force-push-downstream

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the process of force-pushing changes not only to a specified branch but also to all its dependent downstream branches, ensuring consistency across your project's branch hierarchy.

Core Features & Use Cases

  • Automated Branch Synchronization: Pushes changes to a branch and all its downstream dependencies.
  • Smart Skipping: Intelligently skips branches that are already up-to-date with their remote counterparts.
  • Safety First: Utilizes --force-with-lease to prevent accidental overwrites of others' work.
  • Use Case: After making a significant change to a core feature branch, use this Skill to efficiently update all feature branches that were branched off from it, and their subsequent branches, without manual intervention for each.

Quick Start

Execute the force-push-downstream skill starting from the 'main' branch.

Frequently Asked Questions about force-push-downstream

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

FAQPage Schema
How do I force push a git branch and all its downstream branches at once?

You can force push a branch and all its downstream dependencies simultaneously by executing the skill from your target branch. It automatically detects the entire downstream tree and propagates changes to origin in one workflow.

What is the safest way to force push changes to dependent feature branches?

The safest way to force push dependent branches is using the `--force-with-lease` option. This prevents accidental overwrites by ensuring you only push if no one else has updated the remote branch.

How do I skip up-to-date branches when pushing a chain of git branches?

When pushing a branch chain, the skill intelligently skips branches that are already up-to-date with their remote counterparts. This saves time by only force-pushing branches that actually require synchronization.

Can I automate force pushing all branches in a hierarchy to origin?

Yes, you can automate pushing all branches in a hierarchy to origin. The skill detects the downstream branch tree and handles the entire push chain, prompting for user confirmation before executing the force push.

When do I need to force push downstream branches in a CI/CD workflow?

You need to force push downstream branches when you make significant changes to a core branch and must synchronize all feature branches branched off from it. This ensures consistency across your project's branch hierarchy.