I could not quite find an answer to this simple problem. I have created a feature branch and have added several commits. No one else has committed. I have already pushed to remote. I wish to present my code as it exists in my latest commit for pull request, as an initial, clean version, without my own, earlier commits. As the code stands right now, the git change history unnecessarily clutters the pull request.
I have done this:
How do I remove the history from the intermediate commits 2 through 4, and so show the code as it exists in commit 5 as new code showing changes only from commit 1?
Should I simply remove the files from git and re-add them in a new push? or otherwise clean up commits 2 through 4, while keeping the code as it currently stands in no. 5?
Squash your commits. Run git rebase -i HEAD~4
(where 4 is the number of commits you want to squash), then replace "pick" with "squash" for all but the first.