git - 如何在本地 merge 时更改 `git merge --squash` 默认模板?

标签 git github

当我运行 git merge --squash test_branch 时,它显示:

Squashed commit of the following:

commit ac72a4308ba70cc42aace47509a5e
Author: quyen <q@me.com>
Date:   Tue Jun 11 10:23:07 2019 +0500

    Added algorithms for Cosine-similarity

commit 77df2a40e53136c7a2d58fd847372
Author: quyen <q@me.com>
Date:   Tue Jun 11 13:02:14 2019 -0700

    Set stage for similar objects

commit 249cf9392da197573a17c8426c282
Author: quyen <q@me.com>
Date:   Thu Jun 13 16:44:12 2019 -0700

    Fixed a bug in space world automation

但我想要的是:

Squashed commit of the following:
 *  Added algorithms for Cosine-similarity
 *  Set stage for similar objects
 *  Fixed a bug in space world automation

我该怎么办?我不想为提交添加一些细节,只有提交名称就足够了。

最佳答案

我也想知道正确的解决方案。作为 hacky 解决方法,您可以搜索以下正则表达式并将其替换为 * :

\ncommit \w+\nAuthor:.*\nDate:.*\n\n\s+

关于git - 如何在本地 merge 时更改 `git merge --squash` 默认模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60200679/

相关文章:

git - 如何在我的 NetBeans IDE 中设置 github 存储库?

Git:在暂存环境中使用 nvie 的 gitflow 概念

git - 为什么我看到一个已删除的远程分支?

git - Visual Studio 如何在团队资源管理器中打开文件而不是差异窗口更改 git

javascript - 使用 GitHub API 检索具有特定扩展名的文件

git - 为什么我不能在开发更改之前创建一个空的 Pull Request 以供讨论?

git - 试图了解 `git diff` 和 `git mv` 重命名检测机制

没有/a/b 的 Git diff 补丁?

github - 如何从 Github 中删除 D&D 上传的文件?

github - Jenkins 2 GitHub 组织 : Automatic Rebuild for Pull Request