Convert Figma logo to code with AI

pomber logogit-history

Quickly browse the history of a file from any git repository

13,543
534
13,543
87

Top Related Projects

6,958

Gitalk is a modern comment component based on Github Issue and Preact.

:crystal_ball: A lightweight comments widget built on GitHub issues

4,060

A comment system based on GitHub Issues.

Quick Overview

Git History is a tool that allows users to quickly browse the history of any file from any GitHub repository. It provides a visual interface to view how a file has changed over time, showing the differences between versions in an easy-to-understand format.

Pros

  • Intuitive and user-friendly interface for viewing file history
  • Works directly in the browser without requiring installation
  • Supports viewing history for any public GitHub repository
  • Allows easy sharing of file history views with others

Cons

  • Limited to GitHub repositories only; doesn't support other Git hosting platforms
  • May experience performance issues with very large files or extensive history
  • Doesn't provide advanced Git features like branching or merging visualization

Getting Started

To use Git History, simply modify the URL of any file on GitHub:

  1. Go to the file you want to view on GitHub
  2. Replace github.com with github.githistory.xyz in the URL
  3. Press Enter to load the Git History view

For example:

https://github.com/facebook/react/blob/main/packages/react/src/React.js

becomes:

https://github.githistory.xyz/facebook/react/blob/main/packages/react/src/React.js

Alternatively, you can add a bookmarklet to your browser for quick access:

javascript: (function () {
  var url = window.location.href;
  var gitHistoryUrl = url.replace('github.com', 'github.githistory.xyz');
  window.location.href = gitHistoryUrl;
})();

Save this as a bookmark and click it when viewing a file on GitHub to instantly switch to the Git History view.

Competitor Comparisons

6,958

Gitalk is a modern comment component based on Github Issue and Preact.

Pros of Gitalk

  • Provides a full-featured comment system for static websites
  • Supports multiple authentication methods (GitHub, GitLab, Bitbucket)
  • Offers customizable UI and internationalization options

Cons of Gitalk

  • Limited to Git-based platforms for authentication and storage
  • Requires more setup and configuration compared to Git History
  • May have performance issues with a large number of comments

Code Comparison

Git History:

import React from 'react'
import History from './history'

export default ({ children }) => (
  <History>{children}</History>
)

Gitalk:

import 'gitalk/dist/gitalk.css'
import Gitalk from 'gitalk'

const gitalk = new Gitalk({
  clientID: 'GitHub Application Client ID',
  clientSecret: 'GitHub Application Client Secret',
  repo: 'GitHub repo',
  owner: 'GitHub repo owner',
  admin: ['GitHub repo owner and collaborators'],
  id: location.pathname,
})

gitalk.render('gitalk-container')

Summary

Git History focuses on visualizing file history in Git repositories, while Gitalk is a comment system for static websites. Git History is simpler to implement but has a narrower use case. Gitalk offers more features for user interaction but requires more setup and is dependent on Git-based platforms.

:crystal_ball: A lightweight comments widget built on GitHub issues

Pros of Utterances

  • Lightweight, open-source commenting system for blogs and websites
  • Easy integration with GitHub issues for comment storage
  • Supports markdown and emoji in comments

Cons of Utterances

  • Limited to GitHub users for commenting
  • Requires JavaScript to function, which may impact page load times
  • Less flexibility in terms of customization compared to other commenting systems

Code Comparison

Utterances integration:

<script src="https://utteranc.es/client.js"
        repo="[ENTER REPO HERE]"
        issue-term="pathname"
        theme="github-light"
        crossorigin="anonymous"
        async>
</script>

Git History doesn't have a direct code comparison as it's primarily a visualization tool for Git repositories.

Summary

Utterances is a lightweight commenting system that leverages GitHub issues, while Git History is a tool for visualizing file history in Git repositories. They serve different purposes, with Utterances focusing on adding comments to web pages and Git History providing a way to explore code changes over time.

4,060

A comment system based on GitHub Issues.

Pros of Gitment

  • Provides a commenting system for static websites using GitHub Issues
  • Allows users to authenticate with their GitHub accounts
  • Easy to integrate into existing static sites

Cons of Gitment

  • Requires users to have GitHub accounts to comment
  • Limited customization options compared to Git History
  • May not be suitable for non-technical audiences

Code Comparison

Gitment initialization:

var gitment = new Gitment({
  id: 'Your page ID',
  owner: 'Your GitHub username',
  repo: 'The repo to store comments',
  oauth: {
    client_id: 'Your client ID',
    client_secret: 'Your client secret',
  },
})
gitment.render('comments')

Git History usage:

import { GitHistory } from 'git-history'

<GitHistory
  path="src/App.js"
  url="https://github.com/pomber/git-history"
/>

While Gitment focuses on providing a commenting system for static websites, Git History is designed to visualize the history of a file in a Git repository. The code snippets demonstrate the different purposes and implementation approaches of these projects.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Git History

Quickly browse the history of files in any git repo:

  1. Go to a file in GitHub (or GitLab, or Bitbucket)
  2. Replace github.com with github.githistory.xyz
  3. There's no step three

Try it

If you like this project consider backing my open source work on Patreon!
And follow @pomber on twitter for updates.

Extensions

Browsers

You can also add an Open in Git History button to GitHub, GitLab and Bitbucket with the Chrome and Firefox extensions.

Or you can use a bookmarklet.
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");
  }
})();

Local Repos

You can use Git History for local git repos with the CLI or with the VS Code extension.

Support Git History

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

selefra

Backers

Thank you to all our backers! 🙏 [Become a backer]

Contributors

This project exists thanks to all the people who contribute.

Thanks

BrowserStack for letting open source projects use their services for free. Now I can test, debug and fix Safari issues from my Chrome running on Linux!

Credits

Based on these amazing projects:

License

MIT