How to pick a commit in sub-branch and merge it into main branch?

So I have:

master
+commit1
+commit2
+commit3

myBranch
+commitA
+commitB
+commitC

I want to pick commitB in myBranch and merge it to master branch, what should I do?

  • EGit: why “Local branch as upstream is not recommended”?
  • Why would my local changes in Git be overwritten by checkout in this circumstance?
  • git: How to rebase all commits by one certain author into a separate branch?
  • How to switch branches in eclipse without commiting changes
  • GIT: How to protect the branch from being removed by other developers?
  • Output from 'git ls-remote' shows tags not found in 'git tag -l'
  • gitosis authorized keys
  • Git: How to revert a symlink commit which replaced a submodule?
  • Formatting commit messages
  • Git: Preventing Commit During a Rebase
  • Git - What is a git commit ID?
  • git didn't push empty folders
  • One Solution collect form web for “How to pick a commit in sub-branch and merge it into main branch?”

    git checkout master
    git cherry-pick commitB
    

    Or even better, git help cherry-pick and read it.

    Git Baby is a git and github fan, let's start git clone.