git status says:
$ git status # On branch master # Your branch is ahead of 'origin/master' by 2 commits.
You want to git push only one of those commits to the public repo. Here’s how:
First use git log to get the commit hash of the commit you want to push. Then:
$ git push origin <thelonghash>:master
(Thanks to ajax).
Update
You can’t push arbitrary commits this way. See Stefan’s comment below.

Great tip! I love learning something(s) new every day — one of the best things about being involved with you genius types in Fedora, if you ask me.
One should say that only the commits _up to_ the given one
are pushed to the other repo.
It’s not like pushing only one commit, e.g.
if you have commits A->B->C->D and do ‘git push otherrepo C:master’ the commits A,B, and C will be pushed to otherrepo
(if they aren’t already there).
Stefan
Stefan, this is a very good point.
The solution would be to use
git rebase -itorearrange the commits so that ‘C’ is earliest.
Exactly what I needed right now! Thanks!
I have commits(newest —> oldest) A<– B<– C<— D<– E<– F . Commits D, E and F were already pushed in the previous push I did, but they still show up when I try pushing A, B and C. This happens every time I'm doing a push.
I usually do 'cherry-pick' after doing a PR, but I'm tired of seeing already merged commits showing up every time. Can someone help me here
Plus, I don't know how to remove those old commits (D, E and F) before doing a PR.
So, I want to see only UNMERGED and UNPUSHED commits anytime I push.
Thanks for your help.