Is there any way to incrementally build commit messages in git?

前端 未结 3 940
情书的邮戳
情书的邮戳 2021-02-13 02:35

I\'m wondering if it is possible to build git commit messages incrementally, documenting what I\'m doing as I make code changes:

  1. Check out and begin work
3条回答
  •  -上瘾入骨i
    2021-02-13 03:29

    git commit can take a commit message from a file using the -F option. So, you can do something like this:

    # Do some work
    $ echo 'Did some work' > commit-msg.txt
    # Do some more work
    $ echo 'Did some more work' >> commit-msg.txt
    $ git commit -F commit-msg.txt
    

提交回复
热议问题