Git, Commit and Log tool windows
Beginner IntelliJ UI
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 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:
$ 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 BlameThe Source Control view plus the Source Control Graph and the Timeline cover the same ground, with less filtering. See lesson 15.2.
- Commit ⌘0, Git ⌘9, and the VCS widget in the header
- Git → Show History on a file; Annotate with Git Blame in the gutter
- The Log's filter row and search box
- Find Action (⇧⌘A) → "Show History", "Annotate", "Log"
The same information is on the platform: the repository's Commits, a file's Blame view, and the merge request that introduced a change (lesson 9.4).
The Blame button on a file, and the commit history, do the same job in the browser (lesson 10.4).
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.
- Open the Log and find the commit that last changed
docs/faq.md, using the Paths filter. - Select two commits and use Compare Versions to see the difference between them.
- Turn on Annotate with Git Blame on a file and click a line's commit.
- Open the Console tab, then perform any Git action and read the command it logged.
- 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.