git add -u与-A .三者的区别
git add -u:將文件的修改、文件的刪除,添加到暫存區。
git add .:將文件的修改,文件的新建,添加到暫存區。
git add -A:將文件的修改,文件的刪除,文件的新建,添加到暫存區。
-u就是update的意思,只會標記本地有改動(包括刪除和修改)的已經追蹤的文件
???????-u, --update
???????????Update the index just where it already has an entry matching
???????????<pathspec>. This removes as well as modifies index entries to match
???????????the working tree, but adds no new files.
???????????If no <pathspec> is given when -u option is used, all tracked files
???????????in the entire working tree are updated (old versions of Git used to
???????????limit the update to the current directory and its subdirectories).
-A
???????-A, --all, --no-ignore-removal
???????????Update the index not only where the working tree has a file
???????????matching <pathspec> but also where the index already has an entry.
???????????This adds, modifies, and removes index entries to match the working
???????????tree.
???????????If no <pathspec> is given when -A option is used, all files in the
???????????entire working tree are updated (old versions of Git used to limit
???????????the update to the current directory and its subdirectories).
1. ?git add -A ??保存所有的修改
2. ?git add . ????保存新的添加和修改,但是不包括刪除
3. ?git add -u ??保存修改和刪除,但是不包括新建文件。
如圖:
---------------------?
作者:rockly89?
來源:CSDN?
原文:https://blog.csdn.net/ly890700/article/details/53526744?
?
總結
以上是生活随笔為你收集整理的git add -u与-A .三者的区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 图解CMS垃圾回收机制,你值得拥有
- 下一篇: git恢复删除文件之ls-files