I have made a fork from the project manager's master branch. According to my understanding, now the manager's master branch is upstream/master
, the one I just forked is origin/master
. I have made several changes to origin/master
, some of the changes are just adding comments and code for printing intermediate results which serves my own understanding. But there are also changes which are newly written code. I committed all the changes in one single commit. But I want to send a pull request to upstream/master
only for the newly created code. I didn't have an easy solution for my goal, as stated in this Stack Overflow question.
Now I want to create another branch called Branch1
at origin
, and this branch should be identical to the upstream
, then I only commit the newly written code to Branch1
, and send a pull request to upstream
from this Branch1
. Is this approach doable in current github system? If yes, can you please tell me how exactly this can be done.
EDIT
Based on a combination of the following comments, answers and my own searching, I solved the problem. What i did is the following:
git checkout -b Branch1 upstream/master
, this will get an identical copy ofupstream/master
and make it as a new branch namedBranch1
git checkout Branch1
, and in fileconfig
,change the remote forBranch1
toorigin
git checkout master somefolder
, master should beorigin/master
at this point.git commit -m 'message'
git push
,somefolder
will be pushed toBranch1