skip to content
Nino Martinez Wael

Clean Git log recipe

Simplest way of getting clean commits

This is for contributing when forking projects. It allows me todo multiple work in a simple branch, then cherry pick files with different feature purpose and do PR from those without needing to split up work while retaining a clean git log when doing the PR back to the forked project.

Diagram

Commands needed

git merge --squash other-branch
git commit
git rebase -i --signoff HEAD~<number_of_commits>
git push --force -u origin

And if on a rinse repeat cycle remember todo. to begin from fresh:

git reset --hard <commit_id>