| 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から上記の仕様になった([https://github.com/git/git/blob/master/Documentation/RelNotes/2.0.0.txt:title])
git add -u
- 更新・削除された追跡対象ファイルが
addされる(新規作成ファイルはaddされない) git add -u dir1→dir1以下の変更・削除された追跡対象ファイルがaddされるgit commit -a=git add -u+git commit
【参考】