svn - git中 如何为每个文件单独添加注释 再提交
PHP中文网
PHP中文网 2017-04-27 09:03:37
0
3
835
git add .
git commit -m "xxxx"

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

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
刘奇

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.....
大家讲道理

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.

我想大声告诉你

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template