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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:47:44+00:00 2026-05-23T23:47:44+00:00

Setting up a git repository with some messy commits. Everything is working and all

  • 0

Setting up a git repository with some messy commits. Everything is working and all good, but I would like to remove/delete the messy commits – how do you go about doing that?

Thanks

  • 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-23T23:47:46+00:00Added an answer on May 23, 2026 at 11:47 pm

    If you want to go through the entire history, I think the best way would be an interactive rebase

    git checkout master
    git tag oldmaster
    git branch newbranch sha1ofRootCommit
    git rebase -i newbranch

    Your editor should pop up. Delete the lines of the commits you don’t want. If everything goes well and there were no conflicts, master should contain your clean history.

    Here is a link to a similar question

    As CharlesB said you can squash commits into a single one if you still want to keep the changes by replacing pick with squash instead of deleting the line.

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

Sidebar

Related Questions

I have followed the following instructions in setting a git repository locally in one
I have been working on setting up a git server by using Paramiko to
I am setting up a Git repository. I know you can add repositories using
I am pretty sure I have tried everything, figured I would ask all the
I use git all the time and for some reason now every time i
I am setting up my local git project for a remote repository. The remote
I made the move from SVN to Git for some home programming, setting up
can you recommend any no-brainer solution for setting up a git repository accessible via
I have a Git repository with 'master' branch. Some time ago (few months), we
We would like to implement some automated processing of merge requests in a Gitorious

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.