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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:25:41+00:00 2026-06-18T00:25:41+00:00

Imagine a situation where you have two branches of the same project, with one

  • 0

Imagine a situation where you have two branches of the same project, with one part of the first branch dramatically refactored over the other one. But for a while you need to keep both branches functional, so you are doing bug fixes and crucial feature additions to both of them, sometimes in a not symmetrical way. And at some point there comes a moment when you have to merge refactored branch onto the original one. What is the best technique to use in a situation like this? Is it still possible to keep the history clean?

But more importantly what should have been my initial strategy in such scenario?

  • 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-18T00:25:42+00:00Added an answer on June 18, 2026 at 12:25 am

    Since the task was to simply use another branch instead of master, you can simply remove master branch completely or rename it to let’s say – legacy, then take another branch and rename it to master. That’s it. Here are actual commands that you might need to execute to achieve the goal locally and on GitHub:

    git branch -m master legacy               # rename local master to legacy
    git checkout legacy
    git branch -m another_branch master       # another_branch will be our new master
    

    Locally we are done now. However you cannot simply remove master branch on GitHub. You need to take another branch as default first. This can be done in repository Settings > Default Branch. Once you do this, you can proceed:

    git push origin :master                   # remove master on GitHub
    git push origin master                    # push out our new master branch
    git push origin legacy                    # push our legacy branch too
    

    Then go back to Settings > Default Branch and switch default branch back to master. Additionally you can remove all extra branches that you might have created during migration process.

    Alternatively, if you are looking to save all your actions in history, check a correct answer here.

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

Sidebar

Related Questions

Imagine the following situation: I have two branches: DEV and MAIN. I'm working on
Imagine a situation, I have PC with two lan cards, one is connected to
Imagine the following situation: I have project folder, in this folder I have src
I have one page that generates png images on the fly,project is not over
imagine a situation where you have an application that needs to import data from
Probably a very basic beginner question. Imagine the following situation: I have an ASP.NET
I have a question about jQuery load best practice. Imagine the following situation: $(#div).on('click',
imagine there are two interfaces arranged via composite pattern, one of them has a
Let's imagine we have two models: Teams: Id, Name Player: Id, Name, TeamId I
Lets imagine my situation (it's fake, of course)... I have web-site that have 1000

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.