- Initiate the rebase procedure.
- Configure the rebase mode:
- To interactively handle the list of commits to apply, select the Interactive check box.
- To have PyCharm try to recreate merges instead of ignoring them, select the Preserve Merges check box.
Note
This option is available only in the interactive mode.
- Define the contents of the Onto and From drop-down lists. By default, tags and remote branches are not available from them. To expand the lists with tags or remote branches, select the Show Tags and Show Remote Branches check boxes respectively.
-
From the Onto drop-down list, select the required branch and specify the commit to move the base to.
Type the desired commit hash or use an expression, for example, of the following structure:
<branch>~<number of commits backwards between the latest commit (HEAD) and the required commit>Refer to the Git commit naming
conventions for details.
Tip
If you select a tag, no commit specification is required.
- Click the Validate button and view view which files are affected in the specified commit in the Paths affected in commit... dialog box that opens.
-
From the From drop-down list, select the current branch and specify the commit,
starting from which you want to apply commits on top of the new base.
Type the desired commit hash or use an expression, for example, of the following structure:
<branch>~<number of commits backwards between the latest commit (HEAD) and the required commit>Refer to the Git commit naming
conventions for details.
Tip
To apply all commits, leave the field empty.
-
Specify the merge procedure to be applied, when necessary:
- To perform all merges manually, select the Do not use merging strategies check box.
- To have PyCharm apply one of the available merging methods, select the relevant option from the Merge Strategy drop-down list. See the Rebase Branches dialog box reference for description of available options.
- Click the Rebase button and proceed depending on the chosen rebase mode:
- If you have specified the interactive mode, configure the list of commits to apply in the Rebasing Commits dialog box, that opens.
- If you have specified the automatic mode, view the rebase log in the Version Control tool window, resolve conflicts that arise, and resume rebasing


