Selective import of other people requires queries in your own Github plug

Well, I did not find a better way to name my question. Explaining the scenario is easier. But remember this is a Github question , not a Prototype-JS question (please don't add a tag for me)

Scenario

I am working on a Prototype based web application. I found that 1.7.1 (no fault to the author) has several errors that annoy us. All of these errors have, fortunately for us, a publicly available fix through a transfer request that has been accepted into the lead branch.

My boss and I discussed the choice between Prototype 1.7.1 patches for every incompatibility we find, and we agreed that using “development” in a fast production application is not the best choice, so our idea is to fix our version of Prototype.

I am responsible for this. Since I want to track the changes that my company applies to Prototype (even if I'm the only one who touches the JS file), I want to do this in an efficient way that can be left to the offspring.

Github allows you to plug any project into your workspace so you can play with it as much as you want. I would like to track the patches that I import into Prototype, actually linking them to the existing pull requests made in the original project.

General question

Given the general open source project on Github that I forked, is there any way to find the transfer request sent to the source branch and choose to “import” it into my own fork (given that the files must be diff-compatible) so that it applied to my branch?

Of course, this allows me to track over time the records (with comments and discussions) about what PRs that I chose to import in my branch and which not.

+6
source share
2 answers

Given the general open source project on Github that I forked, is there any way to find the transfer request sent to the source branch and choose to “import” it into my own fork (given that the files must be diff-compatible) so that it applied to my branch?

Yes. Here's how I do it:

  • Insert repository in myaccount / project
  • Clone myaccount / project locally
  • Use git remote add [remote name] for each of the remotes that have the fixes you want to use.
  • Run git fetch --all to load everything
  • Use git merge --no-ff -m [remote-name]/[branch-name] to merge the changes of each Pull request that you want to include in your fork. --no-ff creates a merge commit for audit capabilities and -m allows you to specify a message in your editor (so you can include a link to a Pull request in a merge transaction).
  • After you have merged, you can use git push to update your fork on GitHub with the various Pull requests that you have combined.
+1
source

I found the other two ways.

Since PRs come from a branch in a fork, I can create my own Pull request on my local clone / branch, starting from any branch of the author’s source. This is usually easier to edit through the Github web interface, since Github automatically creates a patch-x branch every time you edit files from the user interface. This is basically what I can do from the console, as @johndbritton suggested, but made from a lighter interface.

The best way to approach this is to use git cherry-pick to commit manually. If the commits are hidden, I can, for example, select one commit.

For example, if I choose a PR that I like, I can use git cherry-pick [commit] for each commit made in PR, fixing possible conflicts that might arise.

0
source

Source: https://habr.com/ru/post/950708/


All Articles