Git Course 0%

Git, Commit and Log tool windows

Beginner IntelliJ UI ≈ 9 min

What you will learn

  • What each tool window shows and when to use it
  • How to read the Log tab, including its filters
  • Where blame, file history and the console live

After this lesson you can

  • I can find any Git information in IntelliJ without hunting

Why this matters

IntelliJ splits across three panels what VS Code puts in one. That is more to learn and better once learned, because each panel is genuinely good at its job, and the Log tab in particular answers questions the other tools cannot.

The three

Window Shortcut Holds
Commit ⌘0 / Alt+0 Your pending changes, and the commit message
Git ⌘9 / Alt+9 Tabs: Log, Console, Shelf, Stash, plus Pull Requests or Merge Requests when an account is connected
VCS widget In the window header The current branch and every branch operation

The Commit tool window

Your changes, grouped, with the message box below.

The IntelliJ IDEA Commit tool window, labelled A schematic of the Commit tool window. At the top, a tree of changes with a Changes group containing two files with checkboxes, and an Unversioned Files group containing one file. Below it, the commit message box with a history button, then a row of options, then two buttons: Commit and Commit and Push. Callouts explain that the checkboxes decide what goes into the commit when the staging area is off, that unversioned files must be added before they can be committed, that the history button recalls earlier messages, that the Amend checkbox rewrites the last commit, and that Commit and Push is one action rather than two. COMMIT ☑ Changes 2 files docs/getting-started.md docs/faq.md ☐ Unversioned Files notes.txt Commit message ☐ Amend ⚙ Before Commit… Commit Commit and Push… Checkboxes choose what goes in this commit (with the staging area off, this replaces git add) Unversioned = untracked tick it to add and commit it ⏱ message history reuse an earlier message Amend rewrites the last commit; only before pushing Commit and Push = git commit, then git push
The Commit tool window: changes with checkboxes, unversioned files, the message box with history, and the two commit buttons.

The groups are Changes (modified tracked files), Unversioned Files (untracked), and any changelists you have created. What gets committed depends on a setting (lesson 16.5):

  • Staging area off: the ticked checkboxes.
  • Staging area on: the staged files, exactly like git add.

Two buttons: Commit (⌘K) and Commit and Push… (⌥⌘K). The second is one action, not two, which is convenient and worth using deliberately rather than by habit.

The Git tool window

Log is the tab you will use most. It shows every commit, with a graph, and three panes: the commit list, the details of the selected commit, and its changed files.

Feature Answers
The Branches pane on the left "What branches exist, and where is each one?"
The filter row (Branch, User, Date, Paths) "What did Ben change in docs/ last week?"
The search box "Which commit mentions issue 12?" — searches messages, hashes and authors
Selecting two commits → Compare Versions "What changed between these?"
Right-clicking a commit Cherry-pick, revert, create a branch or tag here, reset the branch here

That right-click menu is IntelliJ's real advantage: Section 12's recovery operations are all there, with the hashes already filled in.

Console shows every Git command the IDE has run and its output, which is the equivalent of VS Code's Git output channel and the best way to learn what an action does (lesson 16.11).

Shelf and Stash hold parked work, and they are different things (lesson 16.8).

File history and blame

Question Where
How has this file changed? Right-click the file → Git → Show History
Who last changed this line, and why? Right-click the editor gutter → Annotate with Git Blame
What did this commit change? Click it in the Log
What did I change before committing? The gutter markers, or Show Diff

Annotate with Git Blame is the single most useful feature here for a non-developer: each line gets its commit, author and date in the gutter, and clicking one opens the commit, which usually leads to the merge request and the discussion that explains it.

The editor's change markers in the gutter, the small coloured bars beside modified lines, are worth knowing too: clicking one shows the previous version of that block with buttons to revert it or copy it.

How to do it

The tool windows, as commands:

Terminal
$ git status                 # Commit window
$ git log --graph --oneline  # Log tab
$ git log -- docs/faq.md     # Show History on a file
$ git blame docs/faq.md      # Annotate with Git Blame

Common mistakes

  • Looking for everything in the Commit window. History lives in the Log.
  • Ignoring the Log's filters and scrolling through thousands of commits.
  • Not knowing about the Console tab, which explains what every action ran.
  • Using Commit and Push by habit, then discovering the commit needed amending.
  • Forgetting that Shelf and Stash are different.

Try it yourself

Goal: answer four questions using only the tool windows.

  1. Open the Log and find the commit that last changed docs/faq.md, using the Paths filter.
  2. Select two commits and use Compare Versions to see the difference between them.
  3. Turn on Annotate with Git Blame on a file and click a line's commit.
  4. Open the Console tab, then perform any Git action and read the command it logged.
  5. Right-click a commit in the Log and read the menu without clicking anything: note how many of Section 12's operations are there.

Expected result: four questions answered without a command, and a sense of which panel answers which kind of question.

Show solution

Step 5 is the observation worth keeping. Cherry-pick, revert, reset and creating a branch from a commit all need a hash in the terminal, and the Log has the hash already selected. That makes IntelliJ the friendliest tool in this course for the recovery operations, precisely because they are the ones where typing a hash is error-prone.

Check yourself

1. Which tool window holds the history, the branches pane and the filters?
2. What does Annotate with Git Blame show?
3. Where can you see the exact Git command IntelliJ ran for an action?

Key terms

Commit Diff Log Branch