How to provide a prepared git commit message?

前端 未结 2 1831
刺人心
刺人心 2021-02-20 03:45

By convention I create my story branches in git to include Jira issue ids in them, e.g. FOO-1001. I have a script to do that for me. Now, I have prepared another script that fet

相关标签:
2条回答
  • There's also -F:

       -F <file>, --file=<file>
           Take the commit message from the given file. Use - to read the message from the standard input.
    
    0 讨论(0)
  • 2021-02-20 04:35

    The commit command has an option for reading a commit message from a template:

     -t <file>, --template=<file>
           When editing the commit message, start the editor with the contents
           in the given file. The commit.template configuration variable is often
           used to give this option implicitly to the command. This mechanism can
           be used by projects that want to guide participants with some hints on
           what to write in the message in what order. If the user exits the editor
           without editing the message, the commit is aborted. This has no effect
           when a message is given by other means, e.g. with the -m or -F options.
    
    0 讨论(0)
提交回复
热议问题