# Makefile for squashing Git commits .PHONY: squash squash: @echo "Checking out the main branch..." git checkout main @echo "Resetting to the initial commit..." git reset --soft $$(git rev-list --max-parents=0 HEAD) @echo "Creating a new commit..." git commit -m "Squashed all commits into one" @echo "Force pushing changes to the remote repository..." git push origin main --force @echo "Squash complete!"