Frage

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

War es hilfreich?

Lösung

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).

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top