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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:01:42+00:00 2026-05-26T23:01:42+00:00

Possible Duplicate: How can I squash my last X commits together using git? I

  • 0

Possible Duplicate:
How can I squash my last X commits together using git?

I have a project hosted on GitHub and I have a local clone. I have a load of small commits that I have already pushed up to GitHub. This has all been done using the default *master branch.

I got confused between merge –squash and rebase etc…
What is the most straightforward way of combining several historial commits in to one commit so that it pushes up to GitHub?

  • 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-26T23:01:43+00:00Added an answer on May 26, 2026 at 11:01 pm

    Before starting, you should make sure that git status is clean (i.e. there’s no output from that command) to avoid losing work. The simplest way to do what you want is probably:

    git reset --soft <LAST-COMMIT-THAT'S-OK>
    git commit -m 'Many squashed commits'
    git push --force origin master
    

    You should bear in mind that this is rewriting history (that’s why you need the --force option to git push) so you should avoid this if anyone else might have cloned or pulled from your repository. For some more alternatives, see this question and its answers:

    • Squash my last X commits together using Git
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Can I have multiple background images using CSS? I am making a
Possible Duplicate: Can JQuery UI and JQuery tools work together? I have a page
Possible Duplicate: Can Read-Only Properties be Implemented in Pure JavaScript? I have an Object
Possible Duplicate: How can I access local scope dynamically in javascript? Hi all. We
Possible Duplicate: Can I use ASP.NET MVC together with regular ASP.NET Web forms Let's
Possible Duplicate: Can someone Explain this jQuery code? I have posted this before, but
Possible Duplicate: Can I use predefined namespaces when loading an XDocument? I have following
Possible Duplicate: Can I set a breakpoint on 'memory access' in GDB? I have
Possible Duplicate: Can you compile C# without using the .Net framework? im sure it's
Possible Duplicate: Can I develop blackberry applications using C#.NET on windows7 can anybody give

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.