100-Days-Of-DevOps-Challenge-KodeKloud

Git Rebase

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

One of the developers is working on feature branch and their work is still in progress, however there are some changes which have been pushed into the master branch, the developer now wants to rebase the feature branch with the master branch without loosing any data from the feature branch, also they don’t want to add any merge commit by simply merging the master branch into the feature branch. Accomplish this task as per requirements mentioned.

Steps

  1. Login into storage server and move into repository

     sudo -i
     cd /usr/src/kodekloudrepos/games
    
  2. Be confirmed that we are in feature branch

     git branch
    
  3. Rebase master branch

     git rebase master
    
  4. Push feature branch

     git push --force --set-upstream origin feature
    

Good to Know?

Rebase vs Merge

Rebase Benefits

Rebase Risks

Interactive Rebase