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

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

Is there any difference between:

git add .

and

git add --all

?

2条回答
  •  余生分开走
    2021-01-31 09:55

    git add --all will add the deleted file too (removing files from index that are no longer in the working tree), while git add . does not.

    For new files and files already tracked in current working tree:

    git add .
    

    For only files already tracked in current working tree:

    git add -u
    

    For new files, files already tracked in current working tree, and remove files from index that are no longer in the working tree:

    git add -A
    

    or

    git add --all
    

提交回复
热议问题