git 使用

修改git log的文字说明内容

命令:

git filter-branch -f --msg-filter 'sed "s/旧的文字/新替换的文字/g"'  -- --all

-- --all表示全分支修改

例子:

$ git log
commit 53d7f2298f510a561730193fe516513d48868053 (HEAD -> master)
Author: 123 <111@111.com.cn>
Date:   Fri Nov 18 15:55:25 2022 +0800

    增加了新文件A

$ git filter-branch -f --msg-filter 'sed "s/增加了新文件A/add 新文件A/g"' -- --all
WARNING: git-filter-branch has a glut of gotchas generating mangled history
         rewrites.  Hit Ctrl-C before proceeding to abort, then use an
         alternative filtering tool such as 'git filter-repo'
         (https://github.com/newren/git-filter-repo/) instead.  See the
         filter-branch manual page for more details; to squelch this warning,
         set FILTER_BRANCH_SQUELCH_WARNING=1.
Proceeding with filter-branch...
Rewrite 53d7f2298f510a561730193fe516513d48868053 (1/1) (0 seconds passed, remaining 0 predicted)
Ref 'refs/heads/master' was rewritten
$ git log
commit ff27d7841cb0d362f27fc48b5b187ee3f5ec7a6c (HEAD -> master)
Author: 123 <111@111.com.cn>
Date:   Fri Nov 18 15:55:25 2022 +0800

    add 新文件A

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值