How can I imagine a partial change to my forked repo as a patch?

I unlocked the repo from GitHub and made a bunch of changes. Then I discovered that one of my changes in one file might be a fix for the problem of the original repo, but the author does not want to merge the other changes, so I do not want to send a transfer request directly. And I think it deploys again and simply modifies this file to make a patch, and then send a pull request doesn't seem so elegant. Is there a "standard" way to do this?

+4
source share
2 answers

In my opinion, you should create a new branch with the same root, and then use cherry-pick to add every commit you made, except for those that are not accepted by the author.

Then send a pull request on this branch.

In addition, if you want to regroup all your modifications into one simple fixer, you can use reba squash in the local branch before clicking it online.

+6
source

Write the SHA-1 hash of the desired commit. Return to the original branch of the original project, create a new branch and cherry-pick , which you will commit to the new branch.

Then you can push a new branch on GitHub and send PR with its changes.

If you changed several files in one commit, you would have to rewrite the commit somehow.

0
source

All Articles