Learn

Git Graph: your history visualized

Antigravity

The extension that displays the Git graph directly in VS Code. Essential for understanding branches.

Git Graph is a VS Code extension that draws your history as an interactive graph: branches, commits, merges, tags. You see at a glance what happened, and you can perform most Git operations from the visual interface.

Installing Git Graph

The extension ID is mhutchie.git-graph. Install it from the Extensions panel or via the terminal:

shell
code --install-extension mhutchie.git-graph

Opening the graph

Two ways to open Git Graph:

  • From the status bar: at the bottom of VS Code, a "Git Graph" button appears after installation. Click it.
  • From the Command Palette: open it with Ctrl+Shift+P, type "Git Graph: View Git Graph" and press Enter.

The graph opens in a dedicated panel. Each row is a commit, each color a different branch.

What you see

  • Commits: each dot on the graph is a commit. The left column shows the date, message, author, and short hash.
  • Branches: each branch has a color. You can clearly see where they diverged and where they were merged.
  • Tags: displayed with a yellow label on the corresponding commit.
  • HEAD: a purple marker showing where you currently are in the history.

Right-click actions

A right-click on any commit opens a context menu with common Git actions:

  • Checkout: move to this commit (detached HEAD) or to the branch.
  • Create Branch: create a new branch from this commit.
  • Cherry Pick: apply this commit to the current branch.
  • Revert: create a commit that undoes this commit.
  • Copy Commit Hash: copy the hash for use in a terminal command.

Comparing two commits

Click on one commit, then Ctrl+click on another: Git Graph shows you which files changed between the two. This is useful for understanding what a branch brings before merging it.

Related

See also · gitWorking with branches
See also · gitMerge or rebase

Concepts-ponts

Concept-pont · Git push, GitHub, et deploiement automatique

Pousser un commit sur GitHub n'est plus juste 'sauvegarder' : c'est aussi le declencheur du deploy continu et la source d'un graphe d'historique visualisable dans l'IDE.

Check off steps to unlock what comes next

Back to course