3

When I run git merge --squash test_branch, it shows:

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

But what i want:

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

How I can do? I don't want to add some details for commit, only name of commit is enough.

babie
  • 1,219
  • 1
  • 10
  • 13
  • 1
    https://stackoverflow.com/q/3605385/6309 or https://stackoverflow.com/a/53493424/6309 might help – VonC Feb 13 '20 at 05:17
  • @VonC How would those help? They explain how to make a squash merge and edit the message, which the OP clearly already knows how to do. The question is how to customize the default template for the message. – Wassinger Aug 30 '20 at 06:19
  • @Wassinger Those apply by specifying the file `.git/SQUASH_MSG` on which you can apply the regex you mention in your answer. – VonC Aug 30 '20 at 09:05

1 Answers1

0

I am also wondering about the correct solution to this. As a hacky workaround, you can search and replace the following Regex with * :

\ncommit \w+\nAuthor:.*\nDate:.*\n\n\s+
Wassinger
  • 347
  • 2
  • 16