Any difference between git add . and git add --all?

后端 未结 2 521
广开言路
广开言路 2021-01-31 09:36

Is there any difference between:

git add .

and

git add --all

?

2条回答
  •  伪装坚强ぢ
    2021-01-31 10:04

    The accepted answer is valid for Git 1.x. But for Git versions from 2.0 and above, following is the difference:

    git add .
    

    Adds, modifies and removes index entries/files in the current directory and its subdirectories.

    While

    git add -all
    

    And

    git add -A
    

    Adds, modifies and removes all index entries/files to match the entire working tree of the repository.

    Refer Git documentation for git add here.

提交回复
热议问题