美文网首页
git commit -F message.txt

git commit -F message.txt

作者: AppleLin_cdea | 来源:发表于2021-10-21 17:56 被阅读0次

    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
    
    

    相关文章

      网友评论

          本文标题:git commit -F message.txt

          本文链接:https://www.haomeiwen.com/subject/axxqaltx.html