Github
GitHub is a code hosting and version control platform for developers to collaborate on software projects.
Website
Industry
Website
Share this article:

How to disable automatic deletion of head branches in a GitHub repository

Here is how to disable automatic deletion of head branches in a github repository

  1. First open the repository where you want to disable automatic branch deletion
  2. Next click on "Settings" tab in the repository navigation menu
  3. Click on "General" option in the settings left sidebar menu
  4. Scroll down to the "Pull Requests" section on the settings page
  5. Then locate the "Automatically delete head branches" option
  6. Finally uncheck the checkbox to disable automatic deletion of head branches

Create your own interactive guide with Guideflow

Why should you disable automatic deletion of head branches in a GitHub repository

GitHub is a vibrant platform designed to streamline collaboration and version control in software development.

Disabling the automatic deletion of head branches in a GitHub repository is a useful feature that allows developers to maintain continuous project visibility. This feature is particularly beneficial for those who wish to retain branch history for future reference and collaborative insights.

By preventing the automatic deletion, you keep your workflow flexible, offering team members ample time to review, learn from past developments, and avoid the unintended loss of valuable code contributions.

Last update
March 12, 2026
Cursor MariaA cursor points to a button labeled "James."

Create your first demo in less than 30 seconds.