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

前端 未结 3 1015
自闭症患者
自闭症患者 2021-02-13 02:57

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条回答
  •  醉话见心
    2021-02-13 03:17

    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
    

提交回复
热议问题