> ## Documentation Index
> Fetch the complete documentation index at: https://docs.parallelane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rebase

> Rebasing onto a branch or commit, and editing history with an interactive rebase

## Rebasing onto a branch or commit

Right-click the target you want to rebase onto and choose **Rebase current branch onto this** (**Rebase current branch onto this commit** when the target is a commit), then click **Rebase** in the confirmation dialog.

<Note>
  In the following two cases, the action is rejected before running and only an error notification appears.

  * **When tracked files have uncommitted changes**, commit or stash them, then try again.
  * **When a merge, rebase, cherry-pick, or revert is already in progress**, finish or abort it, then run the action.
</Note>

## Interactive rebase

<Steps>
  <Step title="Right-click the starting commit">
    Right-click the oldest commit among those you want to edit and choose **Rebase interactively from here…**.
    The commit you clicked is included too.
  </Step>

  <Step title="Edit the plan">
    Commits are listed oldest first.
    Choose an action for each row, and drag the handle on the left to reorder them.

    * **Pick** uses it as is.
    * **Reword** edits the message inline.
    * **Squash** combines it into the commit above (the combined message is editable).
    * **Fixup** combines it into the commit above but discards its message.
    * **Drop** removes the commit.

    The first commit can't be squashed or fixed up, at least one commit must remain, and no message can be left empty.
    If you break a rule, the reason appears at the top of the dialog.
  </Step>

  <Step title="Run it">
    Click **Start rebase**.
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/railgit/SdJRWXTrBLj1X7EN/images/history-rebase-interactive.png?fit=max&auto=format&n=SdJRWXTrBLj1X7EN&q=85&s=48e5b063da6d78419cbaa2f5dbbcce41" alt="The interactive rebase dialog. Each commit row has a drag handle, an action dropdown, and a short SHA with the commit summary" width="886" height="376" data-path="images/history-rebase-interactive.png" />
</Frame>
