1

I guess my title does not self explanatory so let me explain little bit there.

  1. I forked a project from Github repo to my company repo.
  2. Then I forked the project from my company repo into my personal repo
  3. Then I cloned the project from my personal repo.

By default I had/have a master branch. I fixed a lot of things(bugs) and added so many features on this branch. I'm done now and I want to send PR.

AFAIK, PR can be sent by having a branch (which is not exists on origin/upstream) then easily PR can be sent by click on that button on Github page.

Since, I only have master branch and I guess my only solution is cherry-pick from my first commit and then put all my changes on new branch and continue PR process.

I'm wondering is there any other better way to send PR from master branch (to original repo)? any suggestion would be appreciated. Thanks.

Hesam
  • 52,260
  • 74
  • 224
  • 365

1 Answers1

0

Since, I only have master branch and I guess my only solution is cherry-pick from my first commit and then put all my changes on new branch and continue PR process.

You don't have to cherry-pick anything: you can simply create a new branch on top of your current master, which will include immediately all your changes/fixes.

git checkout -b newBranch master

From there, you can initiate a PR using "newBranch" instead of master.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks @VonC, basically you are right. I pushed my newBranch by `git push origin newBranch`. I went to my repo and tried to send PR but the message that I got is "There isn't anything to compare. pires:master and Hesamedin:newBranch are entirely different commit histories." Do you have idea what is happening? Thanks. – Hesam Dec 24 '14 at 15:21
  • @Hesam the history could only be different if you based your branch on top of a cherry-picked one (cherry-pick creates a new history). – VonC Dec 24 '14 at 17:10