Git add-u: Add file modifications, delete files to staging area. git Add.: Changes the file, adds a new file to the staging area. Git add-a: File modification, file deletion, new file, add to Staging area.
-U is the meaning of update, only the local changes (including deletion and modification) are marked.
has been tracedFILE-U,--update
Update the index just where it already have an entry matching
<pathspec>. This removes as well as modifies index entries to match
The working tree, but adds no new files.
If no <pathspec> is given when-u option was used, all tracked files
In the entire working tree is updated (old versions's Git used to
Limit the update to the current directory and its subdirectories).
-a-a,--all,--no-ignore-removal
Update the index not only where the working tree has a file
Matching <pathspec> but also where the index already have an entry.
This adds, modifies, and removes index entries to match the working
Tree.
If no <pathspec> is given when-a option was used, all files in the
Entire working tree is updated (old versions of the Git used to limit
The update to the current directory and its subdirectories).
1. Git add-a Save all the changes
2. Git Add. Save new additions and modifications, but do not include delete
3. Git add-u saves modifications and deletions, but does not include new files.
As shown in figure: