Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:42:13+00:00 2026-06-10T12:42:13+00:00

I need to delete a master branch, but it’s proving to be hard. I

  • 0

I need to delete a master branch, but it’s proving to be hard. I just want to clean that branch out and start new. I am deleting from the dev branch. I want master on GitHub to be clean.

 # git push origin --delete master

> To https://github.com/mymasterb.git  ! [remote rejected] master
> (deletion of the current branch prohibited) error: failed to push some
> refs to 'https://github.com/mymaster.git'

How do I quite simply start my master with a fresh slate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:42:14+00:00Added an answer on June 10, 2026 at 12:42 pm

    As explained in “Deleting your master branch” by Matthew Brett, you need to change your GitHub repo default branch.

    You need to go to the GitHub page for your forked repository, and click on the “Settings” button.

    Click on the “Branches” tab on the left hand side. There’s a “Default branch” dropdown list near the top of the screen.

    From there, select placeholder (where placeholder is the dummy name for your new default branch).

    Confirm that you want to change your default branch.

    Now you can do (from the command line):

    git push origin :master
    

    Or, since 2012, you can delete that same branch directly on GitHub:

    GitHub deletion

    That was announced in Sept. 2013, a year after I initially wrote that answer.

    For small changes like documentation fixes, typos, or if you’re just a walking software compiler, you can get a lot done in your browser without needing to clone the entire repository to your computer.


    Note: for BitBucket, Tum reports in the comments:

    About the same for Bitbucket

    Repo -> Settings -> Repository details -> Main branch
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to delete all the folders in current directory that starts with say
I need to move li element out of its parent ul and into master
Git is saying that I need to pull before pushing to fast-forward but when
I need to delete rows in a table, such as DELETE FROM TABLE_X WHERE
I need to delete and erase object pointer on a vector. I see this
I need to delete a picture from a folder where pictures are stored. For
I need to delete a few fields from the table in the database. I
I need to delete a folder with contents using PHP. rmdir() and unlink() delete
I need to delete a file. Occasionally, the file may be locked, in this
I need to delete an option from a select in certain circumstances. Basically: if(mystatement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.