百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

git-vanity-sha

> 编程语言
开源

虚度六极前缀,用于执行 SHA

300 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

虚度六极前缀,用于执行 SHA

git vanity-sha

This is a Very Good Program inspired by this tweet.

He wasn't joking.

So I thought maybe I'd just write a program to do it.

git vanity-sha will try its darndest to tweak the commiter timestamp of your last commit to produce a commit SHA using the hexadecimal prefix you supply.

$ git commit -am "refactor warp core"
[master 909939a] refactor warp core
 1 file changed, 12 insertions(+), 8 deletions(-)

$ git vanity-sha cafe
Searching for new SHA...

SHA found: cafe7f7fe2054aa79dd6f5e1f994242b70cd7572
Change committer timestamp to 2018-04-27 00:31:18 -0700? This will amend your commit.
(y/n): y

-----------------------------------------------
commit cafe7f7fe2054aa79dd6f5e1f994242b70cd7572
Author: Matt Baker 

refactor warp core

Now you can amend a commit to have a quirky prefix whenever you want except for when git-vanity-sha doesn't find one.

Installation

Grab the git-vanity-sha script and stick it in your path somewhere. Make sure you chmod +x it, and hash -r.

Now you can say git vanity-sha beef in your repo.

Frequently Asked Questions

How does it work?

git vanity-sha will attempt to find a commit SHA starting with the hex prefix you specify by applying a delta to the committer timestamp of your last commit. It starts off making small changes to the timestamp (a few seconds) and gets bigger as it searches (up to several days).

If it finds a timestamp that will cause your commit's SHA to have the target prefix, it will give you the option to amend that commit or abort the process.

Is this a good idea?

Absolutely not.

Will this mess something up?

Probably.

Will you help me if something goes wrong?

Oh god no.

It didn't find a SHA with the prefix I wanted :(

If you're really determined, then change TIMESTAMP_DELTA_MAX to a huge number and go for a walk and maybe you'll get lucky.

It doesn't work, the hash doesn't have the proper prefix!

Do you have commit signing enabled? You need to disable it, otherwise it won't work due to git limitations.

Issues· 4 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言