search

Home  >  Q&A  >  body text

svn - git中 如何为每个文件单独添加注释 再提交

git add .
git commit -m "xxxx"

这样提交,但是会导致所有的文件备注信息都是这一段,提交的文件很多的时候,如何先单独添加注释再提交。

PHP中文网PHP中文网2796 days ago836

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-27 09:05:37

    You can add/commit separately and then push together at the end.

    If there are two files A.md and B.md that need to be pushed, you can do the following:

    git add A.md
    git commit -m "add A"
    git add B.md
    git commit -m "add B"
    git push.....
    

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-27 09:05:37

    Based on the needs of the masturbator, I will give you two options:

    1. Control submission granularity.
    2. Write the message in detail.

    The first option is to submit each modification to a file.
    The second option is not to add the -m parameter when committing, and then the default editor (such as vim) will be called to fill in the commit message. Here, you can write as much as you want.


    I understand the needs of the masturbator, but this is actually not very necessary. Generally speaking, each submission fixes a bug or adds a new feature. It is usually one file or several associated files. This is my submission granularity. It is limited to one issue. Submission remarks The information should simply state what changes were made. There is no need to explain the changes in each file in detail - everyone will see where the code has been changed.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-04-27 09:05:37

    Try to commit one by one, or commit each small change one at a time

    reply
    0
  • Cancelreply