Difference between “git add -A” and “git add .” and "git add -u"
来源:互联网 发布:mac word转pdf 白边 编辑:程序博客网 时间:2024/06/05 05:19
"git add -A
" is equivalent to "git add .; git add -u
".
The important point about "git add .
" is that it looks at the working tree and adds all those paths to the staged changes if they are either changed or are new and not ignored, it does not stage any 'rm' actions.
"git add -u
" looks at all the currently tracked files and stages the changes to those files if they are different or if they have been removed. It does not add any new files, it only stages changes to already tracked files.
"git add -A
" is a handy shortcut for doing both.
You can test the differences out with something like this:
git initecho Change me > change-meecho Delete me > delete-megit add change-me delete-megit commit -m initialecho OK >> change-merm delete-meecho Add me > add-megit status# Changed but not updated:# modified: change-me# deleted: delete-me# Untracked files:# add-megit add .git status# Changes to be committed:# new file: add-me# modified: change-me# Changed but not updated:# deleted: delete-megit resetgit add -ugit status# Changes to be committed:# modified: change-me# deleted: delete-me# Untracked files:# add-megit resetgit add -Agit status# Changes to be committed:# new file: add-me# modified: change-me# deleted: delete-me
Summary:
git add -A
stages Allgit add .
stages new and modified, without deleted
git add -u
stages modified and deleted, without new
原文来自:http://stackoverflow.com/questions/572549/difference-between-git-add-a-and-git-add
0 0
- Difference between “git add -A” and “git add .” and "git add -u"
- 【Git】git add -A = git add . + git add -u
- git add -A和 git add . git add -u区别
- git add -A /git add -u/git add .的用法
- git add and commit
- Git技巧之git add -u与git add -A
- "git add -A" is equivalent to "git add .; git add -u".
- 芒果iOS开发之git add -a和git add -u、git add .区别
- git add .和git add -u和git add -A的区别
- git add -A , git add . ,git add -u三者的区别
- git add . git add -u git add -A命令区别图解
- git add -A和 git add . git add -u作用和区别
- git add
- git add
- git add
- Git add
- git add
- git add
- 关于苹果《Genius Bar 天才吧》预约流程
- java-集合类(二)-迭代器-Iterator-Collections类自然排序
- linux系统-进程管理-基本概念和命令
- objective_c 第九章课后练习题答案
- 湘潭大学oj 1195
- Difference between “git add -A” and “git add .” and "git add -u"
- 学习SQL Server推荐的10本书
- android知识点
- 4.HCNP-R&S-IERN——建立OSPF邻居与邻接关系
- sa5ssd74sg39
- java实现一个在窗口显示一个随机生成的号码
- qemu-kvm 设备虚拟化----I/O 端口和 I/O 内存
- dsad235sag32423
- UI开发----UIController及其子类