Welcome to the Linux Foundation Forum!

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

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

  1. -a
  2. --all
  3. Automatically stage files that have been modified and deleted

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

Comments

  • Posts: 1,268

    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.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training