How to Rebase

Today, I had to rebase my feature branch to include the latest changes from the development branch.

Rebasing allows you to modify the commit history in a way that presents a more linear order of commits. When you rebase, you combine the most recent updates from a branch, in my case development, followed by your feature branch's commits, moving your feature branch to the head of the commit history and also ensuring that your work is built upon the latest changes.

Here is an overview of the steps:

  1. git checkout development or (master/main etc)
  2. git pull
  3. git checkout my_branch
  4. git rebase development
  5. git rebase --continue (or --skip)
    • ... resolve all conflicts ...
    • :wq to get out of vim
  6. git push -f origin my_branch

Noice!!

Avatar for Daniel Callaghan

Written by Daniel Callaghan

Software engineer at Guidewire Software. I like React, next and board games.

Loading

Fetching comments

Hey! 👋

Got something to say?

or to leave a comment.