git initecho Change me > change-meecho Delete me > delete-megit add change-me delete-megit commit -m initial
echo OK >> change-merm delete-meecho Add me > add-me
git status# Changed but not updated:# modified: change-me# deleted: delete-me# Untracked files:# add-me
git add .git status
# Changes to be committed:# new file: add-me# modified: change-me# Changed but not updated:# deleted: delete-me
git reset
git add -ugit status
# Changes to be committed:# modified: change-me# deleted: delete-me# Untracked files:# add-me
git reset
git add -Agit status
# Changes to be committed:# new file: add-me# modified: change-me# deleted: delete-me
# For the next commit$ git add . # Add only files created/modified to the index and not those deleted$ git add -u # Add only files deleted/modified to the index and not those created$ git add -A # Do both operations at once, add to all files to the index
--no-ignore-removal --all | add, modify, and remove index entries to match the working tree
--ignore-removal --no-all | add, modify index entries to match the working tree
--intent-to-add | add an entry for the path to the index, with no content