Skip to content

Add branch cleanup script for Waves 1-2 merged and orphan branches#2435

Open
SatoryKono wants to merge 2 commits intomainfrom
claude/review-branch-consolidation-P7K0I
Open

Add branch cleanup script for Waves 1-2 merged and orphan branches#2435
SatoryKono wants to merge 2 commits intomainfrom
claude/review-branch-consolidation-P7K0I

Conversation

@SatoryKono
Copy link
Owner

Summary

Adds a comprehensive branch cleanup script to remove 679 stale branches from Waves 1-2 of the BioETL project, including merged branches, orphaned branches, backup branches, and duplicate clusters generated by AI assistants (Claude, Copilot).

Changes

  • scripts/cleanup_branches.sh: Bash script with dry-run and execute modes for safe branch deletion

    • Supports batch processing with configurable batch size (default 100)
    • Includes 2-second delay between batches to avoid rate limiting
    • Dry-run mode (default) for safe preview before actual deletion
    • Execute mode with --execute flag for actual deletion
    • Batch size customization via --batch-size=N parameter
  • scripts/branches_to_delete.txt: Plain text list of 679 branch names to be deleted

    • Organized by category: backup branches, main backups, copilot branches, and claude branches
    • Includes merged branches, orphaned branches, and duplicate experimental branches

Rationale

The repository accumulated significant technical debt with hundreds of stale branches from AI-assisted development iterations. This cleanup targets:

  • Backup branches (main_backup_, mainbakup_, backup_*)
  • Orphaned experimental branches (copilot/sub-pr-, claude/ variants)
  • Duplicate architecture audit and refactoring branches
  • Miscellaneous abandoned branches (AAA, diagram-visual-experiments, etc.)

Checklist

  • Script includes safety features (dry-run by default, batch processing)
  • Clear usage documentation in script header
  • Branch list is comprehensive and organized
  • No hardcoded secrets or credentials
  • Follows shell scripting best practices (set -euo pipefail)

https://claude.ai/code/session_01U94fa9HAyxdJpH6mxsjuUm

Wave 1 (33): merged branches, orphan, backups, sub-PR temps
Wave 2 (646): duplicate clusters (keep newest per task name)

Usage: ./scripts/cleanup_branches.sh --execute

https://claude.ai/code/session_01U94fa9HAyxdJpH6mxsjuUm
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Inventory: 2189 remote branches, 2120 orphaned (no common ancestor
with main after history rewrite), 2 fully merged, 46 legit stale
duplicates. ~20 branches kept for review/merge.

https://claude.ai/code/session_01U94fa9HAyxdJpH6mxsjuUm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants