I have a topic branch (macaroni), and I have submitted a pull request. I had to make a change after feedback. It was requested that I squash the two commits into a single commit. This is what I have done:
git status
On branch macaroni
git log
commit def feedback fixes
commit abc fix cheddar flavor
git rebase -i origin/master
.. go through screen where I pick commit to squash ..
.. go through screen where I update commit message ..
git log
commit abc fix cheddar flavor, squashing done!
at this point I believe I have to push my topic branch using the -force flag, because I have changed history:
git push -f
I am using the second answer from this question:
Preferred Github workflow for updating a pull request after code review
with subtitle "Optional - Cleaning commit history". The author mentions at the end that you should be using topic branches, not sure if I should have changed any of the commands since I'm already on a topic branch.
I am also concerned with accidentally force-pushing something onto the master branch with the above since I'm using -f, but since I'm on the topic branch, only that branch should be affected, right?
Thanks