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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:48:13+00:00 2026-05-29T08:48:13+00:00

I don’t know how, bug I’ve arrived to a tree like this: X1–X2–(a lot

  • 0

I don’t know how, bug I’ve arrived to a tree like this:

X1--X2--(a lot commits)--X25--X26 (master)
     \                    \
      \                    D1--D2--merge (demo)
       D1'--D2'---------------------/

Where D1=D1′ and D2=D2′ and the merge is empty. This tree has been pushed to the server, but I’m the only person is working on it.

Not a problem at all, but I’d like to simplify this tree to a more logical one. Something like this:

X1--X2--(a lot commits)--X25--X26 (master)
                          \
                           D1--D2--merge (demo)

It’s possible to remove D1′ and D2′ from my tree?

  • 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-29T08:48:13+00:00Added an answer on May 29, 2026 at 8:48 am

    Each commit in git points backwards to its parents. Because merge points to the commits you don’t want to have anymore, you need to get rid of merge, not just D1' and D2'.

    To do that, use git checkout demo; git reset --hard D2. This will move your demo pointer back to D2.

    Note that you will be doing a Very Bad Thing if you push this to the server and anyone has made a commit that depends on merge, D1', or D2'. Their local history will still have the orphaned commits!

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

Sidebar

Related Questions

I don't know if this has been asked before, but what i'd like to
I don't know whether this is really possible, but I'm trying my best. If
I don't know if this is a well known 'thing' or something new in
(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't know if this has been asked before, so point me to another question
Don't know if anyone can help me with this or if it's even possible.
I don't know: if this works. if it's a good idea. what it is
I don't know if this question is trivial or not. But after a couple
Don't know why this doesn't work. I can't do implicit animation for a newly
Don't know a whole lot about streams. Why does the first version work using

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.