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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:52:58+00:00 2026-06-15T12:52:58+00:00

Previously my code was infected by a horrifying bug wreaking havoc. After a long

  • 0

Previously my code was infected by a horrifying bug wreaking havoc. After a long fight I decided to just $git checkout to a pre-bug commit.

And now $git branch returns a list with the branch “(no branch)” marked. How do I merge (is that the right one?) this into the master branch?

Bonus question: what does even “(no branch)” mean? Can it really be no branch?

  • 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-15T12:52:59+00:00Added an answer on June 15, 2026 at 12:52 pm

    Yes, it can really be “no branch”. You’re running in a state called “detached head”. If you’re not careful, you are going to lose your changes. In a detached head state, git isn’t updating any reference. As a result, if you checkout some other branch, you may lose track of where you were at… and the changes that go with it.

    First, give your branch a name:

    $ git checkout -b new-branch-name
    

    Next, if you want to make your master branch look like the new branch, you have a few choices… some that can lose the history of master, and some that will preserve it. I’ll assume you want the latter.

    The easiest thing to do is while on your new branch, run:

    $ git merge -s ours master
    

    That will bring in master, but won’t apply any of it’s changes due to the -s ours option (this selects the ours merge strategy). Then checkout master, and run:

    $ git checkout master
    $ git merge new-branch-name
    

    At that point, master should look like new-branch-name.

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

Sidebar

Related Questions

I’ve just upgraded and have a problem. Previously this code was working fine: page
I used this code previously in netbeans 6.9.1 but it does not seem to
I'm trying to compile with g++ some code previously developed under Visual C++ 2008
I don't understand why I'm getting this error. I used the same code previously
I am working on some code that previously was using a cfquery, and is
Previously when I browsed source code files using Xcode's file browser (located on left
Previously I've written some very simple multithreaded code, and I've always been aware that
I'm writing code to use UIImagePickerController. Corey previously posted some nice sample code on
The code bellow is giving error on w_add_ax_extra(1, 'k', 'v') previously it was w_add_ax_extra(some_id,
I am using ASP.NET MVC3 with EF Code First. I have not worked previously

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.