$: ls -l
total 4
-rwxr-xr-x 1 P2759474 1049089 474 Nov 2 14:22 tst
$: mv tst new
$: git status
On branch tst
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: tst
Untracked files:
(use "git add <file>..." to include in what will be committed)
new
no changes added to commit (use "git add" and/or "git commit -a")
$: foo="
testing
multiline
git
commit
message
"
$: git add .
warning: LF will be replaced by CRLF in new.
The file will have its original line endings in your working directory
$: git commit -m "$foo" # keeps newlines, but shows without them
[tst 74428e6] testing multiline git commit message
1 file changed, 0 insertions(+), 0 deletions(-)
rename tst => new (100%)
$: git log -1
commit 74428e60d830c417ded3ad2c331f02e73319b862 (HEAD -> tst)
Author: Paul Hodges <paul.hodges@redacted.com>
Date: Thu Nov 3 10:20:33 2022 -0500
testing
multiline
git
commit
message
这同样适用于标记,但您必须知道如何将数据恢复出来。
$: git tag -a example -m "$foo"
$: git tag -l
example
$: git tag -n
example testing
$: git tag -n99
example testing
multiline
git
commit
message
1条答案
按热度按时间s3fp2yjn1#
只要使用简单的双引号就行了。如果这样不起作用,那就是值中的某个东西。
如果你关心的是提交的输出,那只是一个报告。
去看看实际的日志。
这同样适用于标记,但您必须知道如何将数据恢复出来。
你必须告诉它你愿意让它显示多少行信息。默认值是1。