Skip to content

Add squash-history Makefile target to collapse git history into a single commit#27

Merged
paraskuk merged 2 commits into
mainfrom
copilot/remove-previous-commits
Feb 21, 2026
Merged

Add squash-history Makefile target to collapse git history into a single commit#27
paraskuk merged 2 commits into
mainfrom
copilot/remove-previous-commits

Conversation

Copilot AI commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

Addresses the request to eliminate all previous commits, leaving a single commit representing the current repository state.

Changes

  • Makefile — New squash-history target using the orphan branch technique:

    • Creates branch clean-history with no prior history (git checkout --orphan)
    • Stages all files and creates a single "Initial commit (squashed history)" commit
    • Prints the force-push command needed to apply the clean history to main
  • README.md — New Git History Management section covering:

    • make squash-history usage
    • Equivalent manual git steps
    • Force-push warning for shared branches

Usage

make squash-history
# then, when ready to overwrite main:
git push --force origin clean-history:main

Note: Force-pushing rewrites public history. Coordinate with all collaborators before applying to a shared branch.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: paraskuk <5521579+paraskuk@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove all commits except the last one Add squash-history Makefile target to collapse git history into a single commit Feb 21, 2026
Copilot AI requested a review from paraskuk February 21, 2026 12:38

@paraskuk paraskuk left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@paraskuk paraskuk marked this pull request as ready for review February 21, 2026 12:39
@paraskuk paraskuk merged commit 9b35d0a into main Feb 21, 2026
4 checks passed
@paraskuk paraskuk deleted the copilot/remove-previous-commits branch February 21, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants