Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

A project on GitHub that I have a fork of has a new pull request that I want to pull into my fork that the author has not pulled in yet.

Is there a simple way to apply pull requests from other forks into my fork? Is there something else here that I am missing?

1 Answer

0 votes
by (50.2k points)

For this, you can do it manually 

Add a fork as your new remote repository using:

git remote add otherfork git://github.com/request-author/project.git

Then you need to fetch the remote

git fetch otherfork

For pull, you have 2 options: 

One, you can rebase the branch on which your pull request is formed. But this will ignore the eventual commits between origin and pull request. 

git rebase master otherfork/pull-request-branch

Or if you need all the commits in the pull request, then find SHA -1

And use cherry-pick

git cherry-pick <first-SHA> <second SHA>

Thus, you can unmerge upstream pull requests from other forks to your forks.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...