This is a good idea to create separate branches in git repository for a new features. In that scenario, don’t forgot to keep your feature branch up to date from master branch. So update your feature branch on a regular interval to avoid any merge conflicts.

This tutorial will help you to update your feature branch from parent branch. We assume your parent branch is ‘master’. Execute following command to rebase your feature branch with master branch.

git checkout master 
git pull 
git checkout -  
git rebase master 

The above commands do the followings.

  1. Checkout the master branch and switch to it
  2. Update master branch with latest code
  3. Change back to your feature (original) branch
  4. Rebase feature branch with master branch code

How to keep your feature branch up to date. git rebase

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..