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 184749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:20:50+00:00 2026-05-11T15:20:50+00:00

When switching back from a local branch, I accidentally checked out a new branch,

  • 0

When switching back from a local branch, I accidentally checked out a new branch, MASTER, and pushed it to origin. Now the repo has master and MASTER as branches. How do I safely rename MASTER and rebase it into master?

Thanks!

  • 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. 2026-05-11T15:20:51+00:00Added an answer on May 11, 2026 at 3:20 pm

    There’s really no need to rename it. Simply merge or rebase your new changes in MASTER onto master, then delete the MASTER branch.

    • git merge master MASTER will add a merge commit to master, along with the history of individual commits.

    • If you’d rather do a rebase, use git rebase master MASTER.

    After either one of those, run git branch -d MASTER to delete your local MASTER branch. To delete the remote branch, run git push origin :MASTER (via this page). And be sure to push it all to origin afterwards.

    Edit If you really do want to rename it, like if you maintain links to your topic branches, delete the remote branch, rename it locally using git branch -M MASTER foobar and push it to the remote.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

master branch has these files and folders (simplified): C:\Local\TickZoom\Project>ls file.txt name.txt public public branch
Switching from JVM 1.4 to 1.5 has performance benefits as per release notes. http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#performance
I am just now switching back to PHP after enterprise open-source Java development for
After switching from firefox testing to internet explorer testing, some elements couldn't be found
After switching to a new mac at work, I tried to install APC as
We're switching our MVC3 application from IIS 6 to 7.5. I'm working on setting
Originally, I had everything contained in my master branch. Then, I decided to split
One annoying behavior of the VB6 IDE editor, especially when switching back to it
Possible Duplicate: Switching back and forth between mobile and standard views with css /
We're considering switching our site from Prototype to jQuery. Being all-too-familiar with Prototype, I'm

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.