gpt4 book ai didi

git - 如何让 git commit 消息分成多行?

转载 作者:IT王子 更新时间:2023-10-29 01:06:40 26 4
gpt4 key购买 nike

当我使用 git log 查看我的提交说明时,我希望它看起来像这样:

1. what I changed
2. blank line
3. why I changed it

...像这样分成 3 行而不是 1 行:

1. what i changed  2. blank line 3. why i changed

但是,git log 将它显示在一行中。那么,如何使用 git commit -m 实现这一点?

最佳答案

您只需使用以下命令:

$ git commit -m "1. what i changed
> 2. blank line
> 3. why i changed"

在您的终端中,只需按“回车”换行。在您添加结束引号之前,提交消息不会结束。 git 日志将如下所示:

$ git log
commit abcde2f660c707br2d20411581c4183170c3p0c2
Author: Alex Pan <alexpan@stackoverflow.com>
Date: Tue Apr 28 20:52:44 2015 -0700

1. what i changed
2. blank line
3. why i changed

关于git - 如何让 git commit 消息分成多行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29933349/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com