Skip to content

Conversation

@vmoens
Copy link
Collaborator

@vmoens vmoens commented Jan 20, 2026

Adds ghstack clean to delete orphan ghstack branches from the remote.

Over time, gh/{user}/{num}/* branches pile up on the remote with no associated open PR. This happens more often than you'd think:

  • Dropping a commit during git rebase -i after the PR was created
  • Closing/merging a PR manually from GitHub UI instead of using ghstack land
  • Squashing commits that had separate PRs
  • ghstack land or ghstack submit failing halfway through

These branches just sit there forever and there was no way to clean them up. Now there is.

Tested "in prod" in tensordict and torchrl with success

@vmoens vmoens changed the title : remove orphan branches ghstack clean: remove orphan branches Jan 20, 2026
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.

1 participant