Documentation
Topics Overview Overview Agents Quickstart Editor Tutorial Intro Videos Overview Get started Agents Quickstart Agents Tutorial Best Practices Concepts Agents Agent Harnesses Language Models Context Tools Sessions & Handoff Agent Host Architecture Customization Workspace Context Trust & Safety Run agents Agents Window Chat View Choose an Agent Harness Use Tools Browser Tools Approvals & Permissions Review & Revert Changes Artifacts Remote Agent Sessions Plan Work Memory Subagents Sessions Manage Sessions Session History AI Security Customize agents Create and Manage Instructions Agent Skills Custom Agents Language Models MCP Hooks Plugins Tools Prompt Files Use chat Chat Basics Inline & Quick Chat Add Prompt Context Tutorials & guides Customize AI Context Engineering Test-Driven Development Test with AI Test Web Apps with Browser Tools Debug with AI Edit Notebooks with AI Optimize AI Credit Usage MCP Dev Guide Prompt Examples Reference Cheat Sheet Settings Reference MCP Configuration Hooks Reference OpenTelemetry Monitoring Troubleshooting Troubleshooting Debug Chat Interactions Diagnose Prompt Caching FAQ Editor Overview Quickstart Repositories & Remotes Staging & Committing Source Control History Branches & Worktrees Merge Conflicts Collaborate on GitHub Troubleshooting FAQ Get Started Terminal Basics Terminal Profiles Shell Integration Appearance Advanced Debugging Debug Configuration Tasks Testing Integrated Browser Port Forwarding Guides & Tutorials Test-Driven Development Test Web Apps with Browser Tools Overview Enterprise Policies AI Settings Extensions Telemetry Updates Overview VS Code for the Web SSH SSH Tutorial Tunnels Dev Containers WSL WSL Tutorial GitHub Codespaces VS Code Server Linux Prerequisites Tips and Tricks FAQ GitHub Copilot Setup Linux macOS Windows Raspberry Pi Network Portable Mode Additional Components Uninstall Languages & Runtimes Extension DocsOn this page there are 4 sections
View source control history
Source control history helps you understand how a codebase changed, which commits affected a file, and who last changed a line. VS Code provides the Source Control Graph for repository history, the Timeline view for file history, and Git blame information for individual lines.
View branch and commit history
The Source Control Graph in the Source Control view (G (Windows, Linux Ctrl+Shift+G)) shows your commit history and branch relationships. When your branch has an upstream branch, the graph also identifies incoming and outgoing commits.
[Screenshot showing the Source Control Graph with commits and branch relationships.]
Use the graph to:
- Select a commit to view the files that changed.
- Select a changed file to open its diff.
- Select Open Changes to review all changes in a commit.
- Open the context menu for a commit to check it out, cherry-pick it, or add it as context to chat.
- Compare a commit with another branch, a remote branch, or its merge base.
Use the graph toolbar to select a branch and to fetch, pull, push, or sync changes.
Understand incoming and outgoing commits
The graph identifies commits that differ between your current branch and its upstream branch:
- Incoming commits are available on the remote and have not been pulled.
- Outgoing commits exist locally and have not been pushed.
Use the scm.graph.showIncomingChanges and scm.graph.showOutgoingChanges settings to control whether these commits appear. Use the scm.graph.pageSize setting to configure how many commits the graph initially loads.
View file history with the Timeline view
The Timeline view shows events for the file that is active in the editor. These events can include Git commits and local file saves.
-
Open a file in the editor.
-
In the Explorer view (E (Windows, Linux Ctrl+Shift+E)), expand the Timeline view.
-
Select an event to inspect the corresponding file changes.
[Screenshot showing Git commits and local file saves in the Timeline view.]
Use the Timeline filter to show only Git commits or to include events from other timeline providers. Learn more about the Timeline view.
View Git blame information
Git blame information identifies the commit and author that last changed a line. VS Code can show this information in the editor and in the Status Bar.
Use the Git: Toggle Git Blame Editor Decoration and Git: Toggle Git Blame Status Bar Item commands to show or hide blame information. You can also configure these settings:
- git.blame.statusBarItem.enabled : shows blame information in the Status Bar.
- git.blame.editorDecoration.enabled : shows blame information inline in the editor.
- git.blame.editorDecoration.disableHover : hides the blame hover in the editor.
- git.blame.ignoreWhitespace : ignores whitespace changes when Git determines line authorship.
Hover over a blame decoration to view commit details, including co-author trailers. If VS Code adds AI co-author attribution to a commit, the blame hover includes that attribution.
Customize blame information
Use the git.blame.editorDecoration.template and git.blame.statusBarItem.template settings to choose which commit details appear.
For example, the following template shows the commit subject, author name, and relative author date:
| Web Proxy Viewer | New URL | Original Page |