Guide · Open source
How to use git-history: browse a file's commit history
Updated · written with AI from the project's own documentation and checked against our catalogue data
git-history is an open-source tool, licensed under MIT, for browsing how a single file has changed over time. Instead of reading raw git logs, you can view a file's edits as a visual timeline. This guide shows you how to use the web version, the browser extensions, and the local CLI or VS Code options.
Quick start
- 1Open a file. Go to any file on GitHub, GitLab or Bitbucket in your browser.
- 2Change the host. Replace github.com with github.githistory.xyz in the address bar. There is no other step for the web version.
- 3Step through commits. Move through the file's commits to see how it changed over time.
- 4Try the extension or bookmarklet (optional). Install the Chrome or Firefox extension, or add the bookmarklet, to open the history with one click.
- 5Use the CLI or VS Code for local repos. For a local repository, use the CLI from the project's cli folder or install the VS Code extension pomber.git-file-history.
What git-history does
git-history lets you see how a file has changed over time without digging through raw git logs. It focuses on one file at a time, so it is useful when you want to understand a specific file's edits rather than the whole repository.
- Best for understanding why a file looks the way it does
- Useful for reading unfamiliar open-source code
- Gives a visual timeline of one file's edits
- Available inside VS Code for file history
Browse a file's history on GitHub, GitLab or Bitbucket
The web version needs no installation. Open a file on GitHub, GitLab, or Bitbucket, then change the host in the address bar so that it points to githistory.xyz. You can then step through the file's commits.
- Go to a file in GitHub (or GitLab, or Bitbucket)
- Replace github.com with github.githistory.xyz
- Step through the commits of that file
https://github.githistory.xyz/babel/babel/blob/master/packages/babel-core/test/browserify.jsUse the browser extensions or a bookmarklet
You can add an Open in Git History button to GitHub, GitLab and Bitbucket with the Chrome or Firefox extensions. If you prefer not to install an extension, the project also provides a bookmarklet that rewrites the current Git file URL to the githistory.xyz address and opens it in a new tab. If the page is not a Git file URL, the bookmarklet shows an alert.
- Chrome and Firefox extensions add an Open in Git History button
- The bookmarklet opens the githistory.xyz version of the current page
javascript: (function() {
var url = window.location.href;
var regEx = /^(https?\:\/\/)(www\.)?(github|gitlab|bitbucket)\.(com|org)\/(.*)$/i;
if (regEx.test(url)) {
url = url.replace(regEx, "$1$3.githistory.xyz/$5");
window.open(url, "_blank");
} else {
alert("Not a Git File URL");
}
})();Use git-history on local repositories
For repositories on your own machine, git-history offers a CLI and a VS Code extension. The CLI is found in the cli folder of the project repository. The VS Code extension is published on the Visual Studio Marketplace under pomber.git-file-history.
- CLI: see the cli folder in the pomber/git-history repository
- VS Code extension: search the Visual Studio Marketplace for pomber.git-file-history
Know the limits before you rely on it
git-history is built around single files. If you need full repository-wide history or advanced git queries, a tool that works at the repository level will fit better. The web version also depends on the githistory.xyz service, so it is not a fit for offline browsing of hosted repositories.
- Not for repository-wide history or advanced git queries
- The web version relies on the githistory.xyz service, so it does not work offline
What people use it for
- Working out why a function in an unfamiliar open-source project is written the way it is
- Reviewing how a single configuration or source file evolved over time
- Browsing a file's edit timeline from inside VS Code
- Sharing a githistory.xyz link to a file's history with a teammate
Frequently asked questions
Is git-history free?
git-history is released under the MIT licence, according to the project's README. The source is open and the licence text is in the repository.
Do I need to install anything to use git-history?
No. The project's install method is listed as a web app, and the README gives no install commands. You just change the host in a GitHub, GitLab or Bitbucket file URL to githistory.xyz.
How do I use git-history on GitLab or Bitbucket?
Open a file on GitLab or Bitbucket and replace the host with githistory.xyz, following the same pattern as GitHub. The README names GitLab and Bitbucket as supported hosts.
Does git-history work offline?
Not for hosted repositories. The web version relies on the githistory.xyz service, so you need a connection to use it. The CLI and VS Code extension are the options for local repos.
Can git-history show the full history of a whole repository?
No. git-history focuses on the history of single files. For full repository-wide history or advanced git queries, use a different tool.
What are alternatives to git-history?
The project lists gitk, tig and GitLens as comparable projects. git-history is file-focused, so it is best compared with these when you want to see one file's history.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use git-history if you want a quick, visual timeline of how one file has changed, especially when reading unfamiliar code or working in VS Code. Pick a repository-level tool such as gitk, tig or GitLens if you need full repository history, advanced git queries, or offline work.
Install options & downloads