First, use the following command to set git默认的编辑器,其中的“editor" and replace it with your own editor, such as Vim, Emacs, gedit, subl, etc.:
git config --global core.editor "editor -w"
Then, when making a submission, use the command instead of writing "-m"参数,直接写成git commitJust like this, it will automatically open the editor you just specified, and you can add large comments in it.
You can view Git help. -m , --message=
Use the given as the commit message.
Comment based on the given information. The comment content should be enclosed in double quotes. -a, --all
Tell the command to automatically stage files that have been
modified and deleted, but new files you have not told git about are
not affected
All modified and deleted files are listed, but new files are not.
git commit
Then just write your commit comments.
Note: Keep the first line as concise as possible, within 50 characters, then leave a blank line before continuing to write detailed comments.
Also, you can refer to this: "Write a good commit message"
First, use the following command to set
git
默认的编辑器,其中的“editor
" and replace it with your own editor, such as Vim, Emacs, gedit, subl, etc.:Then, when making a submission, use the command instead of writing "
-m
"参数,直接写成git commit
Just like this, it will automatically open the editor you just specified, and you can add large comments in it.Using macvim as the editor for commit, using
-f
参数能避免下面的提示.-w
has no effect.Modify git config in the terminal as follows
You can view Git help., --message= as the commit message.
-m
Use the given
Comment based on the given information. The comment content should be enclosed in double quotes.
-a, --all
Tell the command to automatically stage files that have been
modified and deleted, but new files you have not told git about are
not affected
All modified and deleted files are listed, but new files are not.
-w tells Git to use the specified editor
How to use Git:
git commit -am "bla bla bla"
Have you ever used git gui? However, the git commit -m "your description" command is just for quick submission next time.
git commit
Then just write your commit comments.
Note: Keep the first line as concise as possible, within 50 characters, then leave a blank line before continuing to write detailed comments.
Also, you can refer to this: "Write a good commit message"