git commit comment per file

旧巷老猫 提交于 2019-12-05 00:47:51

Git does not provide such feature. The Git philosophy is to track 'content', not 'files'. Adding files to the staging area allow you to prepare precisely your commit. If several files are added to the staging area, it's because there are linked to the same feature. That's why the commit message represents the whole change.

If you need a message per file, you may consider creating several commits on a feature branch, with only one file per commit.

Hope this helps.

These days you CAN add commit messages to individual files. I just did this for instance:

git commit -m 'reference containers in app' src/App.js

Context: multiple files added to git through $git add . THEN: commit message on this individual file (src/App.js).

[posting answer since this still comes up in google]

Rajith Jarang

You can just go to the folder after some change do:

git add .
git commit -m 'mssg' 

and go back and push it:

git push origin master

In each file in git you will see '+' when you do hover, click on that add your comments for each file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!