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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:32:51+00:00 2026-05-23T13:32:51+00:00

I was wondering if somebody could explain to me how to GIT merge master

  • 0

I was wondering if somebody could explain to me how to GIT merge master into a new branch and then clear out master as to have master clean working directory.

In other words: master -> PHP since master will now have Python.

  • 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-05-23T13:32:52+00:00Added an answer on May 23, 2026 at 1:32 pm

    One solution would be, if nobody has cloned your repo yet, to:

    • make a PHP branch where master currently is
    • reset master to the Python tip

    See:

    git checkout master
    git branch PHP
    git checkout Python
    git checkout -B master Python
    

    From the checkout man page:

    git checkout -b|-B <new_branch> [<start point>]
    

    This form switches branches by updating the index, working tree, and HEAD to reflect the specified branch or commit.

    If -B is given, <new_branch> is created if it doesn’t exist; otherwise, it is reset.

    This is the transactional equivalent of

    $ git branch -f <branch> [<start point>]
    $ git checkout <branch>
    

    But if others have cloned your repo, you need to reset the content of master, keeping all the previous commits.

    That would be a good case for the non-existent merge -s theirs (where your discard your current content and replace it with the one of another branch, like Python in tour case):

    See “git command for making one branch like another” for more.
    (and start first by making the PHP branch where master currently is, like above: that bit doesn’t change and will mark where PHP updates need to go from now on)

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

Sidebar

Related Questions

i was wondering if somebody could help me out. I have a plan of
I was wondering if somebody could explain me how pointers and string parsing works.
I am wondering if anybody out there could explain or provide online examples (yes,
I am new to joomla, and I was wondering if somebody could recommend me
I'm new to the whole push notifications thing, and was wondering if somebody could
Hi there I was wondering if somebody could help me? I have the following
I was wondering if somebody could show me an example of how to use
I was wondering if somebody could help me with how exactly to write some
Wondering if someone could please explain the difference between these two queries and advise
Wondering if someone could help me. I have next to no knowledge with Ajax,

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.