100-Days-Of-DevOps-Challenge-KodeKloud

Git Cherry Pick

The Nautilus application development team has been working on a project repository /opt/official.git. This repo is cloned at /usr/src/kodekloudrepos on storage server in Stratos DC. They recently shared the following requirements with the DevOps team:

There are two branches in this repository, master and feature. One of the developers is working on the feature branch and their work is still in progress, however they want to merge one of the commits from the feature branch to the master branch, the message for the commit that needs to be merged into master is Update info.txt. Accomplish this task for them, also remember to push your changes eventually.

Steps

  1. Login into Storage Server

  2. Move into cloned repository

     sudo su
     cd /usr/src/kodekloudrepos/official
    
  3. Check Git branches

     git branch
    
  4. If you are already in feature branch?

     git log
    

    take note of hash for specific commit we are going to merge into master branch

  5. Switch to master branch to pick commit and push

     git switch master
     git cherry-pick commit-hash
     git push
    

Good to Know?

Cherry-Pick Fundamentals

Cherry-Pick Use Cases

Cherry-Pick Options

Conflict Resolution