سؤال

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