GitLab Documentation

Cherry Pick


Cherry Pick


Cherry Pick

  1. Check out a new 'stable' branch from 'master'
  2. Change back to 'master'
  3. Edit 'cherry_pick.rb' and commit the changes.
  4. Check commit log to get the commit SHA
  5. Check out the 'stable' branch
  6. Cherry pick the commit using the SHA obtained earlier

Commands

git checkout master
git checkout -b stable
git checkout master

# Edit `cherry_pick.rb`
git add cherry_pick.rb
git commit -m 'Fix bugs in cherry_pick.rb'
git log
# Copy commit SHA
git checkout stable

git cherry-pick <commit SHA>