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

  • Home
  • SEARCH
  • 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 8504181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:57:23+00:00 2026-06-11T01:57:23+00:00

My question in similar to git remove commit from a merge but I can’t

  • 0

My question in similar to git remove commit from a merge but I can’t follow instructions suggested there, since my repository’s history is a little bit different.

I’m working on a open-source repository on github. After few months I wanted to update my local repository and I made a useless merge-commit by mistake. The history looks like below:

* commit 3d542ddb64e6474a10dfface24defc69b713a295
| Author: TD
| 
|     fixed typo in dependency_injection/compilation chapter
|    
*   commit 34db3b8c08e5c5d3be4021076716ed90187fe5fb
|\  Merge: b8b73fb 7cc08f4
| | Author: TD
| | 
| |     Merge remote-tracking branch 'upstream/master'
| |   
| * commit 7cc08f476b7ac5610b1eb5b5db5182d18e35a9e9
| | Author: RW
| | 
| |     [#1654] Tweaking comments
...

There should be just one commit with my small change, but there are two. I just want to remove the 34db3b8c0… merge commit. I know I should try interactive rebase, but I don’t know how to set it up. When I try

git rebase -i HEAD~2

I get a huge list of past commits:

pick bbfbddb Add the new "strict_requirements"
pick 31bb8a9 [reference] Tweaking note about strict_requirements
pick fb4d621 [Cookbook][Extension] Fixed typo in functions name
pick d8d1d86 Fixing index typo
# lots and lots of commits in the history here
pick c734436 Fixed indentation.
pick ca8d884 Update cookbook/logging/channels_handlers.rst
pick 7cc08f4 [#1654] Tweaking comments in channel handlers doc to point to reference
pick 3d542dd fixed typo in dependency_injection/compilation chapter: should be contAiner instead of continer

# Rebase b8b73fb..3d542dd onto b8b73fb
#
# Commands:
...

But when I try:

git rebase -i HEAD~1

(wanna have a shorter list) I get only one commit:

pick 3d542dd fixed typo in dependency_injection/compilation chapter: should be contAiner instead of continer

As far as I understood, I should squash the merge commit 34db3b8c08… using interactive rebase, right?

Thanks for any help.

  • 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-11T01:57:25+00:00Added an answer on June 11, 2026 at 1:57 am

    Try git rebase upstream/master. So, your commit will be applied at the remote master. The merge commit will be dropped as useless.

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

Sidebar

Related Questions

Question similar to this: select from two tables where linked column can be null
Similar to this question , how can I make an existing Git branch track
I realize that there are similar questions , but my question is slightly different:
I read a similar question about this that suggested using git log --graph --all
I have a question that's similar to How to undo 'git add' before commit?
This is a question similar to a question here . I wonder is there
I have asked a question similar to this in the past but this is
Question is similar to this , earlier question Which Dimitre has answered already. There
There is already a similar Hosted Solution for Version Control — with pre-commit hooks?
I know similar questions have been asked many times. But all I can find

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.