template/Makefile

15 lines
418 B
Makefile
Raw Normal View History

2024-10-02 19:47:02 +01:00
# 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!"