Skip to content

Rebase workflow with feature branches

A rebase workflow with feature branches is a Git strategy that integrates changes from a main branch (typically master) into a feature branch using git rebase. This approach creates a linear project history, incorporating the latest upstream changes before merging the feature back into the main branch^[600-developer__tools__git__git-rebase.md].

Workflow Procedure

The standard rebase workflow follows a sequence of branching, updating, replaying, and merging.

  1. Feature Development: Create and switch to a feature branch (e.g., issue or feature) to implement changes^[600-developer__tools__git__git-rebase.md].
  2. Update Main: Switch to the main branch (master) and run git pull to ensure it has the latest changes from the remote repository^[600-developer__tools__git__git-rebase.md].
  3. Rebase Feature: Switch back to the feature branch. Execute git rebase master to move the base of the feature branch to the tip of master^[600-developer__tools__git__git-rebase.md]. This replays the feature commits on top of the updated main history.
  4. Resolve Conflicts: If conflicts occur during the rebase, resolve them manually^[600-developer__tools__git__git-rebase.md]. After fixing the files, stage them with git add . and continue the process with git rebase --continue^[600-developer__tools__git__git-rebase.md].
  5. Final Merge: Switch back to master and perform a fast-forward merge using git merge issue^[600-developer__tools__git__git-rebase.md].
  6. Cleanup: Delete the feature branch to remove the obsolete reference^[600-developer__tools__git__git-rebase.md].
  • [[Feature Branch Workflow]]
  • [[Git Merge]]
  • Git Rebase

Sources

^[600-developer__tools__git__git-rebase.md]