Assuming that <filename> is being tracked by git, is git commit -m "message" <filename> possible without doing a git add <filename>?

有帮助吗?

解决方案

Yes. If you issue:

git commit -m "message" /file/to/save.c

save.c will be added and committed alone, provided that it is already tracked by Git.

You can find it mentioned in the Git commit manual page (point 3 of the first list).

其他提示

To avoid having to explicitly add each file you modify, you could use git commit -a -m "message": it will automatically add each tracked file and commit.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top