360 Secure SkillHub
360 安全技能中心

Git History Rewriter / Git历史重写器

这是一款Git历史管理工具,核心功能包括合并琐碎提交、修正历史提交作者信息、拆分复杂提交、调整提交顺序,以及清理Git历史中的大文件或敏感数据(Pro版支持批量处理、预览等进阶功能)。适用于误提交敏感信息到公开仓库、团队合并多仓库后作者信息混乱、整理混乱分支提交历史以便上游审查等场景,通过命令行操作,可预览修改影响后再执行。

kingaiwork
kingaiwork
热度 12.99
最近更新 2026-07-08 03:00:20
分类:开发依赖:代码执行应用场景:DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add git-history-rewriter
Metadata
name
git-history-rewriter
description
Squash, split, or reorder commits, rewrite author info, and clean large files from Git history. / 合并、拆分或重排提交,重写作者信息,清理大文件。
version
1.0.0
topics
["git","commit-history","rebase","cleanup","版本控制","历史清理"]
metadata
{"openclaw":{"requires":{"bins":["bash","curl"]},"emoji":"✂️","homepage":"https://kingai.work/","install":[]}}

✂️ Git History Rewriter / Git历史重写器

Squash, split, or reorder commits, rewrite author info, and clean large files from Git history. / 合并、拆分或重排提交,重写作者信息,清理大文件。

🦁 由 KingAI.Work 出品 — 智能进化|vip@kingai.work


Features / 功能特性

• Squash multiple commits into one clean commit / 将多个琐碎提交一键合并为一个整洁的提交,让项目日志从杂乱变精炼 • Rewrite author name and email for any commit, past or present / 批量修正任意历史提交的作者信息,彻底告别“无名氏”贡献记录 • Split a single commit into separate logical changes / 把一个复杂提交拆解成多个逻辑独立的改动,让代码审查一目了然 • Reorder commit sequence with drag-and-drop simplicity / 拖拽式调整提交顺序,就像整理播放列表一样轻松 • Strip large or sensitive files from entire Git history (Pro) / 从整个Git历史中永久移除大文件或敏感数据,Pro版支持深度扫描和过滤 • Preview rewrite impact with dry-run mode before applying changes (Pro) / 应用更改前通过试运行预览重写影响,Pro版提供冲突预检测,避免误操作

Quick Start / 快速开始

git history-rewriter --squash HEAD~5..HEAD -m "Combined feature work" Squashes the last 5 commits into one with a new message. / 将最近5个提交合并为一个,并赋予统一描述,让主干提交历史更清爽。 

Use Cases / 使用场景

• Accidentally committed an API key to a public repo / 不小心将API密钥提交到了公开仓库,普通删除无法抹去痕迹,使用该工具从历史中彻底清除该文件的每次出现。 • Team needs uniform author names after merging from multiple repos / 团队合并了多个仓库后,作者姓名混乱,该工具可一次性地将所有“OldName”替换为“NewName”,贡献者图谱恢复清晰。 • Preparing a messy feature branch for upstream review / 准备向上游提交混乱的功能分支前,用该工具将20个开发草稿提交压缩为3个逻辑清晰的提交,并调整顺序让演进脉络更合理。

Plans / 方案对比

Feature Free Pro
Core / 核心功能 ✅ ✅
Batch / 批量处理 — ✅
AI / AI 增强 — ✅
Support / 支持 Community Priority

• Unlock bulk file removal from any commit in history, not just the last few. • 解锁从任意历史提交中批量移除文件的能力,不再受限于最近几条记录。 • Access advanced dry-run diff preview and rollback safety nets. • 获得高级试运行差异预览与一键回滚安全网,告别“改完就后悔”。 • Remove size and file type filters for cleaning massive blobs or archives. • 移除大小和文件类型过滤限制,轻松清理几百MB的二进制大块或归档文件。\n\n

About the Publisher

Published by King AI — kingai.work | vip@kingai.work