git add -A と git add . と git add -u の違い

stack overflowに僕の知りたかったことが書かれていたので要約します。
結論から言えば、git add -Agit add . git add -u を足したものです。


git add . はワーキングツリーに新規作成された、もしくは変更されたファイルをaddします。つまり、rmコマンドなどで削除されたファイルはaddされません。

git add -u は一つ前と最新のステージを比較して、変更があった部分のみをaddします。つまり、新しく作られたファイルはaddされません。

最初にも述べたように、git add -Agit add . git add -u を足したものですから、新規作成、修正、削除といった全てのファイルをaddします。

分かり易い例がさきのリンクに記述されているので読んでみてください。


追記
git add -uはupdateのu, git add -Aはallのaだと最近気付きました......。

追記 2015/06/09

ಠ_ಠ $ git add -A
warning: The behavior of 'git add --all (or -A)' with no path argument from a
subdirectory of the tree will change in Git 2.0 and should not be used anymore.
To add content for the whole tree, run:

  git add --all :/
  (or git add -A :/)

To restrict the command to the current directory, run:

  git add --all .
  (or git add -A .)

With the current Git version, the command is restricted to the current directory.

Git 2.0から git add --all もとい git add -A の仕様が変わりました
git add -A . では 指定したdirectory( . だとcurrent directory) のfileをすべてaddします
これまで通りの git add -Aとして使いたい場合は git add -A :/として使ってください