DevOps Classroomnotes 29/Apr/2022

Git Contd

Merge and cherry-pick

  • Merging branches is one way of bringing changes from one branch to other.
  • As of now of status of the branch is as follows
    Preview
  • Lets create a branch from rel_tata_v1.0 and call it as feature_1001
  • The changes which i have done on the feature_1001 branch i want them to be brought to rel_tata_v1.0
  • The way to do this is called as merge. You checkout to the branch where the code has to be merged
    Preview
  • This merge is referred as fast-forward merge
    Preview
  • Lets create a branch from rel_wipro_v1.0 and call it as feature_1002
  • In rel_wipro_v1.0 now make a change and create new commit
  • In feature_1002 branch make changes and create a new commit
    Preview
  • Now merge the changes from feature_1002 to rel_wipro_v1.0
  • When we perform some operations in Git like merge, rebase, cherrypick, pull etc will lead to a situation which is referred as merge conflict.
    Preview
    Preview
    Preview
    Preview
    Preview
    Preview
    Preview
  • Move to the feature_1002 branch
    Preview
  • Lets assume we need the commit 4b6072d into the rel_tata_v1.0 branch
  • Now move to the rel_tata_v1.0 branch and perform cherry pick
    Preview
    Preview
    Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner