git add -A和git add --update:/ for github有什么区别? [英] What is the difference between git add -A and git add --update :/ for github?

查看:216
本文介绍了git add -A和git add --update:/ for github有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  add --update:/ 

有人告诉我这是拾取所有已添加,删除和更新的文件的最佳方式。

然而,阅读后:git add -A和git add。



我想也许我应该使用 git add -A



有人可以告诉我是否存在差异, git add --update:/ 实际上有什么区别吗?

解决方案> git add --update:/ 会更新或移除先前追踪的来自整个工作树的文件。它不会添加新文件。



git add -A 也会更新,删除以前跟踪的文件,但它也会添加新的文件。由于此命令没有明确的 pathspec :/ ,你的更新命令可以做到这一点,这取决于你的git版本,这可能适用于整个工作树中的所有文件,也可能是当前目录以及所有子文件夹和文件。



有关更多信息,可以找到git add的文档: http://git-scm.com/docs/git-add


I was in the past using the git command for my github files:

add --update :/ 

as someone told me this was the best way to pick up all the files that had been added, deleted and updated.

However after reading: Difference between "git add -A" and "git add ."

I think maybe I should be using git add -A

Can someone tell me if there's a difference and what git add --update :/ actually does?

解决方案

git add --update :/ will update or remove previously tracked files from the entire working tree. It will not add new files.

git add -A will also update, remove previously tracked files, but it will also add new files. As this command doesn't have the explicit pathspec of :/ that your update command does, depending on your version of git, this may be for all files in the entire working tree, or it may be for the current directory and all subfolders and files.

For more info, the docs for git add can be found: http://git-scm.com/docs/git-add

这篇关于git add -A和git add --update:/ for github有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆