Git Rebase

git rebase master or

git rebase master feature_branch
  There are two ways to integrate the feature branch with the master, that is merging directly and rebasing and then merging. Merging directly results in a 3-way merge and has a merge commit. Rebasing and merging is a fast-forward merge and a perfect commit history.   Having a clean commit history is good, especially when it comes to finding bugs. Imagine a bug occurs in the code and the developer could not track where the bug was introduced using git log. Now, he may run git bisect to find the bad commit. Because the commit history is clean, the git bisect has a refined set of commits to work on. This helps the developer to find the bug faster.   We can run git rebase in an interactive mode by either giving the option -i or –interactive
git rebase --interactive
This triggers the interactive mode. Interactive mode means we can play with the commits. Instead of the standard rebase, which moves all the commits blindly, the interactive commit let us alter with the commits. We can choose the commits we need, keeping the history cleaner. We can pick the commit, alter the commit, squash or discard the commit.   Rebasing is a very helpful way to integrate your branches while keeping your commit history clean, which helps while debugging.]]>