Command | New Files | Modified Files | Deleted Files | Scope |
---|---|---|---|---|
git add -A |
⚪︎ | ⚪︎ | ⚪︎ | 全てのディレクトリ |
git add . |
⚪︎ | ⚪︎ | ⚪︎ | カレントディレクトリ |
git add -u |
× | ⚪︎ | ⚪︎ | 全てのディレクトリ |
git add -A
- 変更された全てのファイル(新規作成・更新・削除されたファイル)が
add
される git add -A dir1
→dir1
以下の変更された全てのファイルがadd
される
git add .
- カレントディレクトリ以下の、変更された全てのファイルが
add
される git add dir1
→dir1
以下の変更された全てのファイルがadd
される- Git Version 1.xまでは削除されたファイルは
add
されなかったが、2.xから上記の仕様になった(git/2.0.0.txt at master · git/git · GitHub)
git add -u
- 更新・削除された追跡対象ファイルが
add
される(新規作成ファイルはadd
されない) git add -u dir1
→dir1
以下の変更・削除された追跡対象ファイルがadd
されるgit commit -a
=git add -u
+git commit
【参考】