Hide commit and timeline noise in GitHub PRs
// ==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);
})();