Applying a GitHub pull request in your fork?

Are you using a GitHub tool/library/plugin with a pull-request that makes your life easier, but its author

Are you using a GitHub tool/library/plugin with a pull-request that makes your life easier, but its author has not merged it yet? Do you need it urgently but you do not have time to contact its author? Git’s flexibility allows us to apply commits from one place to another easily! See how to do it in 4 simple steps!

1. Fork

Firstly, we fork the repository we are interested in to our GitHub account.Let us see the following repository as an example: https://github.com/katzer/cordova-plugin-background-mode. We choose the option fork to fork it to our account:

Applying a GitHub pull request in your fork?

2. Clone

We make the clone of our forked repository:

Applying a GitHub pull request in your fork?

3. Merge

Here it gets interesting. We make a pull of the original repository, and we specify the pull request whose ID appears in the url of GitHub. For example, if we want the following pull request:

Applying a GitHub pull request in your fork?

When we choose it, we see that the url is https://github.com/katzer/cordova-plugin-background-mode/pull/112
That ID after the pull/ is the ID of the pull request we want. Then, the pull would be:

Depending on the change, it may be necessary to make a merge of some conflict.

4. Push

We make a push and we have the pull-request merged in our repository:

Then we can make reference to it; for example, if it were a Node.js plugin we could add it  to our packages.json:
Share this articleShare on LinkedInTweet about this on TwitterShare on FacebookShare on Google+Email this to someone
Go Back