FG
💻 Software

How can I squash commits in git?

Fresh5 days ago
Mar 15, 20268509 views
Confidence Score0%
0%

Problem

I want to simply squash a bunch of git commits that are no longer needed. I attempted to follow documentation from this site, but I ended up with git saying there is nothing to squash. I only have one branch, so I followed that section. Any ideas?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I squash commits in git?

Low Risk

If I were doing it I'd use "rebase". Assuming you have your branch checked out, and that it is branched from master, do This will allow you to modify the commits from master to your current branch. In your case, replace with (for ) or (for , which i…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment