If you have done C2 in its own branch, all you need to do is:
- update your master with upstream/master
- rebase your C2 branch on top of upstream/master
- make your pull request from C2 branch.

Note that if you rebase C1 branch on top of upstream/master, your existing pull request will automatically be updated!
See also "How to do a Github pull request?".
The OP user10 adds in the comments:
I committed C1
in my master and gave pull request.
I did changes C2
, and don't know where to commit and how to give pull request without adding C1
.
This is my problem.
So you have:
y--y--y--y (origin/master)
\
x--C1--C2 (master)
First, don't do any rebase on top of origin/master
, which would trigger an update on your existing pull request (but this time, with C1
and C2
from your rebased master
, as I mention in my pull request tips, in the second point)
Make sure C2 is in own branch:
git checkout master
git branch bC2
git reset --hard master C2~
git tag C2base master
If C2
is composed of several successive commits, replace C2~
by the first commit of the C2
series, followed by a '~
'.
This assume C2
commits follow C1
commits.
Make sure you don't have any work in progress (not committed): the 'reset --hard
' would erase those.
Note that the tag C2base
reference the commit just before C2
. We will need it below.
y--y--y--y (origin/master)
\
x--C1 (master)
^ \
| --C2 (bC2)
(C2base)
Then a git pull --rebase origin
will replay your master on top origin/master
.
y--y--y--y (origin/master)
\ \
| x'--C1' (master)
|
x--C1
^ \
| --C2 (bC2)
(C2base)
Note how C1
gets duplicated here, and is still referenced through the bC2
branch.
Finally, make sure your bC2
branch is done on top of origin/master
has well:
git rebase --onto origin/master C2~ bC2
git tag -d baseC2
Which gives you:
C2' (bC2)
/
y--y--y--y (origin/master)
\
x'--C1' (master)
(The old C1
commit is no longer referenced by anything, so it disappears in the reflog, which can be used to revert improper rebase, for instance)
And you now can do your pull request from the bC2
branch, which contains only C2
commits!