git commit -F message.txt

2021-10-21  本文已影响0人  AppleLin_cdea

2021年10月21日17:41:38 星期四
git commit -F message.txt 的用法

示例

$ls
demo.txt  message.txt

要被 commit 的文件 demo.txt

$cat demo.txt 
this is a demo.

commit 的 message 放在文件 message.txt

$cat message.txt 
[new] hello

    first commit
$git status
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

    new file:   demo.txt

commit 的命令 git commit -F message.txt

$git commit -F message.txt 
[master (root-commit) 572fc9d] [new] hello
 1 file changed, 1 insertion(+)
 create mode 100644 demo.txt

查看一行 commit 日志

$git log --oneline 
572fc9d [new] hello

查看完整 commit 日志

$git log
commit 572fc9df2c164ae0ec9362dd5c0508cbfd623167
Author: autoinfra.admin <autoinfra.admin@hygon.cn>
Date:   Fri Jul 30 19:27:50 2021 +0800

    [new] hello
    
        first commit

上一篇下一篇

猜你喜欢

热点阅读