Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I submit partial change of my forked repo as patch?

Tags:

github

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?

like image 521
ArkChar Avatar asked Apr 24 '13 09:04

ArkChar


People also ask

How do I make changes to a forked repository?

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.

How to fork a repo in GitHub?

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. ...

How do I update a fork in GitHub?

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.

How do I verify my fork is synced with the upstream 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 ."


1 Answers

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.

like image 57
Charles-Édouard Coste Avatar answered Oct 19 '22 20:10

Charles-Édouard Coste