What can I do with it?
If upsteam changes your commit history (squashing commits) in their repo, you have to do the same in your repo - reset master
to upsteam master
and force push
- losing your individual commits in the process, but gaining the squashed commit in exchange.
git switch master
git fetch
git reset --hard upsteam/master
git push -f origin
This is a destructive operation and force pushing to master may even be blocked in Github repository settings, but sometimes it has to be done.
If your upstream is going to squash your commits anyway, you may want to consider squashing them on your end before creating pull request.
I'm not sure if rebase may help, but there are my commits and other people's commits. So it is a mess there and I'm not sure what to rebase.
Do a git log
to see where is your next feature branch (from which you want to do your second pull request):
git log --graph --format=format:"%h% - %aD (%ar)%d%n %s - %an" --abbrev-commit --all --branches
Refresh your upstream:
git fetch upstream
Rebase only your commits on top of the pull request target branch
git rebase --onto upstream/master yourFirstCommit~1 yourBranch
That will rebase every commits after "yourFirstCommit" (as seen in the git log
graph above) up to your branch HEAD.
Once those commits are on top of upstream/master
, your pull request (after a git push --force) will be updated, showing only your commits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With