What exactly does git add -A do?
Simple git workflow
When working on my personal projects I have always followed a simple git workflow that involves nothing more complicated than creating a new branch adding and comitting my changes into the new branch, then merging the new branch into master and pushing it to bitbucket or github.
What does git add -A actually do?
Git Version 1.x
In git version 1.x
git add -A is a shorthand way of typing the
git add --all command that stages (adds) all new, modified and deleted files.
This is in itself a shorthand way of typing the commands
git add . stages new and modified files only and
git add -u stages modified and deleted files only.
Git Version 2.x
In git version 2.x the
git add commands have changed so that
git add . is now equivalent to
git add -A
So, when I upgrade from git 1.x to 2.x I will be able to save typing one character by using
git add . instead.