首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >git add .、git add -A和git add -u之间的区别

git add .、git add -A和git add -u之间的区别
EN

Stack Overflow用户
提问于 2018-01-30 22:07:34
回答 1查看 668关注 0票数 1

以下命令之间有什么区别?

  • 吉特加。
  • git添加-A
  • git添加-u

我试着执行它们,它们会产生相同的结果。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-30 22:16:20

git help add

代码语言:javascript
复制
   -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, the current version of Git defaults to "."; in other words, update all files in the current
       directory and its subdirectories. This default will change in a future version of Git, hence the form without <pathspec>
       should not be used.

   -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, the current version of Git defaults to "."; in other words, update all tracked files in the
       current directory and its subdirectories. This default will change in a future version of Git, hence the form without
       <pathspec> should not be used.
  • 如果没有给出.,则-A-u都暗示了<pathspec> (在您的问题中是这样的)。
  • -A将进行更改、删除文件和添加文件。
  • -u将进行更改和删除文件,但不添加文件。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48531321

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档