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

问题描述

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



git add -A 也会更新,删除以前跟踪的文件,但它也会添加新的文件。由于此命令没有明确的


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有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 17:22