1

My current repo is ahead of the repo I forked from. I was wondering, is there a way I can create a new branch off of master, pull in the files I changed, and create a PR from this branch?

The issue is I don't want to create a PR for all of my changes in master. For example, I have changes to:

src/
   file1
   file2
   file3

from my master to theirs in my fork. I want to pull in all there changes, and then only send my changes to file2 in a PR.

Rob
  • 3,333
  • 5
  • 28
  • 71

1 Answers1

1

If you create a PR branch, create it from upstream/master (with upstream being the remote name for the original repo, that you have forked)

git remote add upstream /url/original/repo
git fetch upstream
git checkout -b mypr upstream/master

From then, as commented, you can cherry-pick your commits (or even ranges of commits)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250