First of all, determine if you need new changes from master to integrate into your function branch. Perhaps you can ignore new changes with master . If they do not conflict with your changes in test , then this is the easiest thing, and the developer can still combine your PR.
You can easily verify that this is happening by checking out the GitHub PR page. If you get the message βcannot be automatically drainedβ, you will need to use one of the following solutions.
The standard way to enable upstream changes without merging is to reinstall again:
git checkout test git rebase master
Since this overwrites the story, you need to force click:
git push --force-with-lease
Your PR will be updated with all your commits and will now include new entries in master in its history.
Mandatory Warning . Since rebooting overwrites history, it can be dangerous / destructive for everyone who works in this thread. Be sure to let us know what you have done with someone you work with.
If you do not want to reinstall, your other options are:
- Combine
master into test , but you stated that you did not want to do this. git cherry-pick any new commits to master . This has the disadvantage of duplicating these commits in your branch.- Squash the
master into test : git merge --squash master . This is similar to cherry-pick , but only creates one commit.
source share