GitHub PR Hide Commits

Hide commit and timeline noise in GitHub PRs

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Advertisement:

// ==UserScript==
// @name         GitHub PR Hide Commits
// @version      2026-06-10.1
// @description  Hide commit and timeline noise in GitHub PRs
// @match        https://github.com/*/*/pull/*
// @source       https://github.com/orgs/community/discussions/12985
// @license      MIT
// @namespace https://greasyfork.org/users/1611379
// ==/UserScript==

(function () {
    'use strict';

    const style = document.createElement('style');
    style.id = 'timeline-css';

    style.textContent = `
        /* Hide commit-related timeline events (GitHub internal event IDs) */
        .js-timeline-item[data-gid^="C_"],
        .js-timeline-item[data-gid^="CRE_"],
        .js-timeline-item[data-gid^="RRE_"],
        .js-timeline-item[data-gid^="RDE_"],
        .js-timeline-item[data-gid^="CTDE_"],
        .js-timeline-item[data-gid^="DEE_"],
        .js-timeline-item[data-gid^="DEME_"],
        .js-timeline-item[data-gid^="LE_"],
        .js-timeline-item[data-gid^="MIE_"] {
            display: none !important;
        }

        /* Hide commit push entries via URL pattern */
        .js-timeline-item:has(a[href*="/commit/"]) {
            display: none !important;
        }

        /* Hide "force pushed" noise */
        .js-timeline-item:has(svg[aria-label*="force"]) {
            display: none !important;
        }
    `;

    document.head.appendChild(style);
})();