I forked a repo from GitHub and make a bunch of changes. Then I found one of my modification in one file can be a patch to an issue of the original repo, but the author don't want to merge my other modifications, so I don't want to send a pull request directly. And I think forking it again and just modify that file to make a patch and then send pull request seems not so elegant. Are there any "standard" way to do that?
All changes are always made on the local clone and then pushed to the fork. So to update your forked repository, you will first pull in all the changes (commits) from the original repo into your local clone, and then push those changes to your fork. In the command line, move to your repository folder: cd repositoryname.
Fork a repo 1 About forks. Most commonly, forks are used to either propose changes to someone else's project or to use someone else's project as a starting point for your own idea. 2 Fork an example repository. Forking a repository is a simple two-step process. ... 3 Keep your fork synced. ... 4 Find another repository to fork. ... 5 Celebrate. ...
The fork is updated on the remote and you now need to update the changes to your local repository. Go to your GitHub desktop and make sure your current repository you are working with is selected. You will able to see a “pull origin”. What this does is it pulls the remote changes to your local repository.
To verify the new upstream repository you've specified for your fork, type git remote -v again. You should see the URL for your fork as origin, and the URL for the original repository as upstream. Now, you can keep your fork synced with the upstream repository with a few Git commands. For more information, see " Syncing a fork ."
In my opinion, you should make a new branch with the same root, then use cherry-pick to add every commit you made except those who are not accepted by the author.
Then send a pull request on this branch.
Moreover, if you want to regroup all your modifications into one simple commit, you may use a squash rebase on a local branch before pushing it online.
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