Say I made several commits and wish to cherry pick which ones I push to the remote repository. How can I do that (in ascii: C1->C2->C3->C4 and I want to push C2 and C4). Wil
What you're looking for:
git push origin commit-id:master
Credit goes to: http://blog.dennisrobinson.name/push-only-one-commit-with-git/
Explanatory notes:
git rebase -i) first, so they are
in the order you want to push them.commit-id doesn't have to be a sha1. To push everything before the
last N commits, use "HEAD~N" in place of commit-id.If pushing to a branch that doesn't exist in the remote repository yet, prefix the remote branch with refs/heads/, such as:
git push origin HEAD~1:refs/heads/completely-new-branch
(If not, git will punish you with this hopeless error message).