GitAuto Logo
  1. Home
  2. Pricing
  3. Docs
  4. Dashboard
  5. Blog
  6. Contact
  1. Home
  2. How It Works
  3. Use Cases
  4. Pricing
  5. Docs
  6. Dashboard
  7. FAQ
  8. Blog
  9. Contact

Sibling Branch Retarget

When you change the target branch on the rules page, GitAuto automatically retargets all open PRs to the new base branch. If the old and new branches are siblings, GitAuto rewrites the PR to produce a clean diff.

Sibling branches are branches that fork from the same parent (e.g. main) at different points in time, rather than one being the ancestor of the other. For example, release/20260401 and release/20260501 are siblings if they both branched off main independently. This is a common pattern for teams that use date-based or versioned release branches.

The Problem

GitHub's "change base branch" API only updates metadata - it doesn't touch the git history. When two release branches are siblings (both forked from the same trunk at different points), changing the base causes the PR diff to explode with hundreds of unrelated files. Git recomputes the merge base against an entirely different branch, and every file that differs between the two release branches appears in the diff.

How GitAuto Handles It

  1. Savethe PR's actual file contents from the current branch
  2. Change the base branch on GitHub (metadata only)
  3. Reset the local branch to the new base via git fetch + git reset
  4. Rewrite the saved files onto the new base
  5. Commit per file with the correct verb (Add, Update, or Delete) and force push

The result is a clean PR diff showing only the actual changes, regardless of how different the two base branches are.

How to Trigger

  1. Change the target branch on the rules page. GitAuto will retarget all open PRs for that repository.
  2. Or leave a review comment on a specific PR asking to change its target branch (e.g. "please target release/20260501 instead").

Why Not Merge?

Sibling branches share no common ancestor besides the trunk (e.g. main). When you run git merge from the new base into the PR branch, Git walks back to that distant fork point and pulls in every change from the other release branch. The PR ends up with hundreds of unrelated files in the diff, which is the same problem you started with.

Why Not Rebase?

A human developer would use git rebase --onto, but this has two problems in automation: rebase can hit merge conflicts and halt (requiring manual resolution), and it requires full commit history which is unavailable in shallow clones (--depth 1).

Our save-reset-rewrite approach avoids this entirely. GitAuto PRs typically add new test files or update existing ones, so they rarely touch the same files as the release branch. And even if the PR's version of a file is outdated after retargeting, the tests will fail, and GitAuto automatically catches and fixes that in its normal workflow.

Need Help?

Have questions or suggestions? We're here to help you get the most out of GitAuto.

Contact us with your questions or feedback!

Auto-Merge

Getting Started

  • Installation
  • Setup

Triggers

  • Overview
  • Schedule Trigger
  • Test Failure Trigger
  • Review Comment Trigger
  • Dashboard Trigger

Coverage Dashboard

  • Overview
  • Python Testing
  • JavaScript Testing
  • Java Testing
  • Go Testing
  • PHP Testing
  • Ruby Testing
  • Flutter Testing
  • Multi-Language
  • Coverage Charts

Customization

  • Repository Rules
  • Output Language
  • GITAUTO.md

Integrations

  • CircleCI Integration
  • npm Integration

How It Works

Context Enrichment

  • Line Numbers
  • Full File Reads
  • Test File Preloading
  • Test Naming Detection
  • Error Baselines
  • CI Log Cleaning
  • Trigger-Specific Prompts
  • Coding Standards

Output Auto-Correction

  • Diff Hunk Repair
  • Diff Prefix Repair
  • Tool Name Correction
  • Tool Argument Correction
  • Import Sorting
  • Trailing Space Removal
  • Final Newline
  • Line Ending Preservation
  • Sanitize Tool Arguments
  • Lint Disable Headers

Quality Verification

  • Formatting
  • Linting
  • Type Checking
  • Test Execution
  • Coverage Enforcement
  • phpcs / phpstan Support
  • PHPUnit Support
  • pytest Support
  • Snapshot Auto-Update
  • Untestable Detection
  • Should-Skip Detection
  • Dead Code Removal
  • Quality Check Scoring
  • Quality Checklist

Safety Guardrails

  • File Edit Restrictions
  • Temperature Zero
  • PR/Branch Checks
  • Race Condition Prevention
  • Bot Loop Prevention
  • Webhook Deduplication
  • Duplicate Error Hashing
  • Infrastructure Failure Detection
  • Strict Tool Schemas
  • No-Change Detection

Token/Cost Management

  • Token Trimming
  • Outdated Diff Removal
  • Stale File Replacement
  • Skip CI Intermediate
  • CI Log Deduplication
  • Web Fetch Summarization
  • Context Forgetting
  • File Query Routing
  • On-Demand Diff

Resilience & Recovery

  • Model Fallback
  • Overload Retry
  • Forced Verification
  • Error Files Editable

Hallucination Prevention

  • Web Search
  • URL Fetching
  • Anti-Hallucination Prompts
  • GITAUTO.md Restrictions
  • Review Response Guardrails

Ready to improve your test coverage?

Go from 0% to 90% test coverage with GitAuto. Start for free, no credit card required.

Install FreeContact Sales

Product

  • Home
  • Why GitAuto
  • What GitAuto Does
  • How It Works
  • Use Cases
  • How to Get Started
  • Solution
  • Pricing
  • Pricing Details
  • ROI Calculator
  • ROI Methodology
  • FAQ
  • Blog
  • Contact

Dashboard

  • Dashboard
  • Coverage Trends
  • File Coverage
  • Credits
  • Open PRs
  • Usage
  • Triggers
  • Actions
  • References
  • Rules
  • CircleCI Integration
  • npm Integration

Documentation

  • Docs
  • Getting Started
  • Setup
  • Triggers
  • Coverage Setup
  • Customization
  • How It Works
  • Auto Merge
  • CircleCI
  • npm

Legal

  • Privacy Policy
  • Terms of Service

Connect

  • GitHub
  • LinkedIn
  • Twitter
  • YouTube
GitAuto Logo© 2026 GitAuto, Inc. All Rights Reserved