Welcome to the Linux Foundation Forum!

git -a "will add and commit" is not correct: -a means "--all"

Options

In https://trainingportal.linuxfoundation.org/learn/course/gitops-continuous-delivery-on-kubernetes-with-flux-lfs269/essentials-of-git-workflows/git-workflows?page=5 at 2:55 is stated "git commit -am". "-a" will add and commit

-a actually means --all and is used instead of providing the name(s) of the file(s) that is to be committed.

https://git-scm.com/docs/git-commit

-a
--all
    Automatically stage files that have been modified and deleted

Without -a the commit would be performed with commit -m "updated README" README.md

Comments

  • luisviveropena
    luisviveropena Posts: 1,282

    Hi @sanderhollaar,

    I checked on the documentation and you are right. '-a' parameter means the following:

    "Automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected".

    Per the documentation here:

    https://git-scm.com/docs/git-commit

    And then '-m' is the associated message to the commit operation.

    Regards,
    Luis.

Categories

Upcoming Training