Say I do the following steps:
- fork some project, create a topic branch
- push that branch over at GitHub
- request a pull from that branch to the original project
However, I get some comments to improve stuff on the code.
- I fix up the code, do a commit
- Rebase to squash old commits
Problem is, I can’t push it anymore to the topic branch over at GitHub.
What’s the best way of handling this then?
Once rebased, you cannot just add new commits on the forked repo (since you have replayed those commits during the rebase, rewriting their SHA1), you have to force your push:
And then re-do your pull request.
This is ok since nobody has yet cloned your repo and started to used your branch.
If that branch was already used, follow that blog post: