jvliwanag
jvliwanag

Reputation: 1598

Rebase on github branch

Say I do the following steps:

However, I get some comments to improve stuff on the code.

Problem is, I can't push it anymore to the topic branch over at GitHub.

What's the best way of handling this then?

Upvotes: 14

Views: 6678

Answers (1)

VonC
VonC

Reputation: 1328712

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:

git push -f

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:

Important: If you've already pushed commits to GitHub, and then squash them locally, you will not be able to push that same branch to GitHub again.
Create a new branch--like 100-retweet-bug-squashed or 100-retweet-bug-rc1 (for release candidate 1)--and squash your commits there.
Once everything is squashed and ready, push the new squashed branch to GitHub and send your pull request to Gina.

Upvotes: 16

Related Questions