PyCharm 2021.2 Help

Log tab

This tab is only available if you are using Git or Mercurial for version control.

Login tab of the Git tool window

This tab shows all local and remote branches, and all changes committed to all branches, or to a specific branch or repository.

The tab contains the following panes:

Git log tab
  1. The Branches pane is located on the left and shows all local and remote branches. From this pane, you can switch between branches, create new branches and delete the ones you don't need anymore, filter the log by branch, and more.

  2. The Commits pane is located in the central part of the tool window and shows the commits to all or to the selected branches.

  3. The Changed Files pane is located on the right of the tool window and shows the list of files that were modified within the selected commit.

  4. The Commit Details pane is located on the right under the Changed Files pane and shows the details of the selected commit.

Branches Pane

The Branches pane lists all local and remote branches, and lets you perform all branch operations.

Branches pane toolbar

IconActionDescription
Icons actions arrow collapseHide Git BranchesHide the Branches pane.
Icons welcome create new projectNew BranchCreate a new branch based on the selected branch.
Icons actions check outUpdate SelectedFetch changes from the selected branch.
Android studio icons common deleteDelete BranchDelete the selected branch
Icons actions diffCompare with CurrentCompare the selected branch with the branch that is currently checked out.
Icons actions searchShow My BranchesFilter the list to only display branches created by you.
Icons actions refreshFetch All RemotesFetch changes from all remote branches.
Icons nodes favoriteMark/Unmark as FavoriteMark the selected branch as a favorite one. Favorite branches are displayed on top of the list. Also, you can choose to only see favorite branches in the Branches popup by choosing Show Only Favorites at the bottom of the list.
Icons actions group by packageGroup By DirectoryGroup the branches by directory.
Icons actions expandall Icons actions collapseallExpand All / Collapse AllExpand/collapse the list

Branches pane context menu

ItemDescription
CheckoutCheckout the selected branch.
New Branch From SelectedCreate a new branch based on the selected branch.
Checkout and Rebase onto CurrentRebase a branch on top of the current branch.
Compare with CurrentCompare the selected branch with the branch that is currently checked out.
Show Diff with Working TreeCompare the selected branch with the local state of the branch that is currently checked out.
Pull into Current Using RebaseFetch changes from the selected branch and rebase the current branch on top of these changes.
Pull into Current Using MergeFetch changes from the selected branch and merge them into the current branch.
UpdatePull changes from the selected branch.

You can select multiple branches to update them in a batch.

PushPush outgoing commits to the selected branch.
RenameRename the selected branch.
DeleteDelete the selected branch.

You can select multiple branches to delete them in a batch.

Commits Pane

This area shows a list of all commits made to the selected branch, or to all branches. For each commit, the list shows the commit message, the author, and the commit timestamp. The latest commit in each branch is supplied with a label with the name of the branch in which it was performed.

commit labels
  • yellow: marks the current branch head

  • violet: marks remote branches

  • green: marks local branches

commit labels
  • brown: marks closed branches

  • yellow: marks tips (the latest revision in the repository)

  • green: marks open branches

  • violet: marks bookmarks

Commits to the current branch are displayed against the light blue background, while commits to all other branches are shown against the white background.

Commits made by you are marked with bold.

Clicking an arrow takes you to the next commit in a long branch:

jump to next commit

You can also press the Left and Right keys to jump to the parent/child commit. This is especially useful if you have commits to different repositories and multiple branches all mixed in the Log tab of the Version Control tool window Alt+9.

In multi-repository projects, the colored stripe on the left indicates which root the selected commit belongs to (each root is marked with its own color). Hover the mouse cursor over the colored stripe to invoke a tip that shows the root path:

root path

You can also enable the Show Root Names option if you want to expand the Roots column with full root names.

Committed changelists often correspond to issues in tracking systems. You can jump to such issues in a browser right from the Commits pane. This functionality is available if:

  • The pattern of the bug tracking system is specified in the Issue Navigation Settings Preferences dialog.

  • The corresponding issue number is mentioned in the commit message.

After issue navigation has been configured, issue numbers in commit messages are rendered as links. Clicking such link brings you to the corresponding page of your issue tracker.

Commits pane toolbar

ItemTooltip and ShortcutDescription
Search fieldN/A

Use this field to search through the list of commits. You can enter full commit names or messages, or their fragments, revision numbers, or regular expressions. To finalize the search, press Enter or move the focus away from the search field.

Click Find to display the previous search patterns.

Click the Clear icon to clear the search.

the Gear iconText Filter Settings

Click to select from the following options:

  • Regex: anything you type in the search field is treated as a regular expression, for example, #\d+.

  • Match Case: only entries with the matching case count.

BranchN/AFilter commits by branch or favorite branches. If you want to see commits from all local and remote branches, select All.
UserN/AFilter commits by author. To view all commits by a specific author, click Select and start typing the author's name. To view commits by all users, select All.
DateN/AFilter commits by a time-frame or a specific date. To view commits made on a specific date, click Select and specify the date. To view commits made on all dates, select All.
PathsN/AFilter commits by the folder (for projects that have one root), or by the root and folder (for multi-rooted projects). To view commits to a specific folder, click Select Folders and specify the folder name. For multi-repository projects, you can also select the checkbox next to one or several roots in the Roots section.
the Refresh icon

Refresh

Ctrl+F5

Refresh the list of commits.
the Cherry-Pick button

Cherry-pick (Git)

Graft (Mercurial)

Apply changes from the selected commit to the current branch.

the IntelliSort buttonIntelliSortIf this option is enabled, you get a more convenient way to view merges by displaying incoming commits first, directly below the merge commit.
the Eye iconPresentation Settings

Click to invoke the list of options that let you configure how data is presented in the Log tab of the Version Control tool window Alt+9:

  • Compact References View: if this option is enabled, branch references for a single commit are displayed in a collapsed view: compact references view

    If you want to expand each branch reference on a line, deselect this option: expanded references view

  • Show Tag Names: enable this option if you want tag names to be displayed in addition to the tag icon:

    tag name

    If this option is disabled, you can still view a tag name by hovering the mouse over the tag icon.

  • Show Root Names: enable this option if you want to expand the Roots column on the left showing full root names in a multi-repository project.

    root name
  • Show Long Edges: if this option is enabled, long branches are displayed in full, even if there are no commits in them. If this option is disabled (by default), long branches are replaced with a down arrow.

  • Show Commit Timestamp: enable this option if you want PyCharm to show the commit timestamp in the Log view instead of the time when a change was authored.

  • Collapse Linear Branches: enable this option to collapse all branches on the graph so that a dotted line is shown instead of successive commits.

    It is also possible to collapse an individual expanded branch by clicking it.

  • Expand Linear Branches: enable this option to expand all collapsed branches to show successive commits on the graph.

    It is also possible to expand an individual collapsed branch by clicking it.

  • Highlight: select if you want to highlight the following:

    • My Commits: bold font

    • Merge Commits: greyed out

    • Current Branch: blue background

    • Not Cherry-Picked Commits: greyed out (only available for Git). Non-picked commits are commits from the selected branch that have not yet been applied to the current branch.

  • Show Columns: customize columns in the log. You can choose whether you want the log to show the author, the date, and the commit hash.

the Open Another Log Tab iconOpen Another Log tabOpen a new log tab matching your filters, so that you don't have to set filters back and forth.
the Find icon

Go to Hash/Branch/Tag

Ctrl+F

Click this button and specify a hash, tag or branch you want to jump to.

You can select a reference with the same name from different repositories. The name of each repository is displayed on the right along with its color indicator.

Commits pane context menu

ItemDescription
Copy Revision NumberCopy the revision number of the selected commit to the clipboard.
Create PatchCreate a patch based on the selected commit.
Cherry-pickApply changes from the selected commit to the current branch.
Checkout RevisionCheck out the state of files recorded in the selected commit.
Show Repository at RevisionOpen a snapshot of your project at the selected revision in the Project view.
Compare with LocalCompare the state of the repository at the selected commit with its current state in your local working copy.
Reset Current Branch to HereReset the current branch head to the selected commit. In the Git Reset dialog that opens, select the mode in which the working tree will be updated.
Revert CommitRoll back the changes in the selected commit. A new commit will be created that reverts the changes in the selected commit.
Undo CommitRevert the changes in the selected commit. This command is only available for the commits made by you.
Edit Commit MessageModify the message of the selected commmit. This action is only available for commits that haven't been pushed yet.
FixupAdd staged changes to the selected commit instead of creating a separate commit. Only the commit message of the original commit will be preserved.
Squash IntoAdd staged changes to the selected commit instead of creating a separate commit. The messages from both commits will be preserved.
Interactively Rebase from HereEdit the history of the current branch by performing an interactive rebase of all commits after the selected one.
Branch <branch_name> / Branches

This command appears for all branches that point to the selected commit (Branch <branch_name> if there is one branch, or Branches if there are multiple branches) and provides the same options as the ones available from the Branches popup and the context menu of the Branches pane.

If the Control repositories synchronously option is enabled, and the selected branch exists in multiple repositories, an additional menu option named In All Repositories appears that allows you to perform the same operations in all repositories simultaneously.

New BranchCreate a new branch based on the selected commit.
New TagAdd a new tag to the selected commit.
Go to Child CommitJump to the next commit in this branch.
Go to Parent CommitJump to the previous commit in this branch.
Open on GitHubOpen the page that corresponds to the selected commit on GitHub.
ItemDescription
Copy Revision NumberCopy the revision number of the selected commit to the clipboard.
Create PatchCreate a patch based on the selected commit.
Graft (Mercurial)Apply changes from the selected commit to the current branch.
Update to RevisionChange your working copy parent revision to the selected commit. New commits will carry on from the revision (commit) you update to.
New BranchCreate a new branch based on the selected commit.
New TagAdd a new tag to the selected commit.
Branch <branch_name> / Branches

This command appears for all branches that point to the selected commit (Branch <branch_name> if there is one branch, or Branches if there are multiple branches) and provides the same options as the ones available from the Branches popup and the context menu of the Branches pane.

If the Control repositories synchronously option is enabled, and the selected branch exists in multiple repositories, an additional menu option named In All Repositories appears that allows you to perform the same operations in all repositories simultaneously.

MQ

Use this submenu to manage Mercurial Queues:

  • Import: use this command to turn the selected changeset into a patch.

  • Goto patch: use this command to open the MQ: <project_name> tab that shows a queue of patches that have not been applied yet.

  • Rename Patch: use this command to rename the selected patch.

  • Finish Patches: use this command to turn the selected patch into a permanent changeset.

Changed files pane

This pane shows a list of files that were modified within the currently selected commit.

Changed files pane toolbar

ItemTooltip and ShortcutDescription
the Show Diff icon

Show Diff

Ctrl+D

Open the Differences viewer for files where you can compare the local version of the selected file with its repository version.
the Revert buttonRevert Selected Changesroll back the changes in the selected file.
the History Up to Here buttonHistory Up to HereOpen the History tab for the selected file that lets you explore the history of all file revisions.
the Group by buttonGroup ByChoose how you want to group modified files: by directory and/or module.
Icons general filterFilter ByChoose if you want to hide the following from the log:
  • Hide files moved without changes: these are files that were moved from another location, but their content remained intact.

  • Hide files with non-important changes: these are files where changes were made only within import statements, or only affected formatting.

Configure layoutConfigure LayoutChoose the following options:
  • Show Details: show the Commit details pane.

  • Show Diff Preview: open the Preview Diff pane where you can explore the differences between the selected modified file and its repository version.

the Expand All button the Collapse All button

Expand All/Collapse All

Ctrl+NumPad +

Click this button to expand/collapse all nodes.

Note that these buttons are only available only when tree-view is enabled.

Context menu commands

ItemDescription
Show Diff Ctrl+DClick to open the Differences viewer for files where you can compare the current and the previous revision of the selected file.
Compare with LocalCompare the revision of the file in the selected commit with its current local version.
Compare Before with LocalCompare the reversion of the file before the selected commit with its current local revision.
Edit Source F4Open the local copy of the selected file for editing.
Open Repository VersionClick to open the repository version of the selected file for editing.
Revert Selected ChangesClick to roll back the changes in the selected file. This option is useful, when you only need to revert specific files instead of discarding an entire commit. Changes that revert the selected file will be placed in the active changelist.
Cherry-Pick Selected ChangesClick to apply the selected changes to the current branch.
History Up to HereOpen the History tab for the selected file that lets you explore the history of all file revisions.
Show Changes to ParentsDisplay changes to both parents for a merge commit to review merge results, and see how exactly conflicts were resolved during a merge.

Commit Details

This area is displayed when the Show Details the Show Details button option is enabled.

This area shows the details on the commit selected in the commits list, such as the commit message, hash, author, the link to the author's email, date, time, root and branches.

If the selected commit is contained in more than six branches, only the first six are displayed and the Show All link appears that you can click to expand a complete list of branches.

If a commit message references another commit, you can click this commit's hash to jump to it in the log.

Last modified: 14 September 2021