如果有的话,git add *和git add。有什么区别? [英] What's the difference between git add * and git add ., if any?

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

问题描述

git animals

a>有这样一系列的命令:

$ g $ g $ g $ g $ g $ g $ g $ g $ b $ git git commit -a - '

什么是 git add * do与 git add。(我通常会这样做)是相同的吗?

git add * 将添加 shell 扩展的所有路径 * ,而 git add。会告诉git添加当前目录。



git add * 不会添加以开头的路径作为<$ c $的shell扩展



git add * 将这些视为隐藏路径。也会失败,如果任何扩展路径目前被git忽略,因为git认为它是一个错误,如果你明确指定如果没有传递 -f (强制)标志来显示你确实想添加一个被忽略的路径,那么这个路径被忽略。



如果你得到git来扩展glob( git add'*'),它会添加hidden文件并跳过忽略的文件。在这种情况下,它的作用与 git add。相同。


git animals had this series of commands:

git init
git add *
git commit -a -m ‘initial commit and release!’

What does git add * do compared to git add . (which I normally do) are they the same?

解决方案

git add * will add all the paths that are the result of the shell expansion of * whereas git add . will tell git to add the current directory.

git add * won't add paths that begin with a . as the shell expansion of * considers these to be "hidden" paths.

git add * will also fail if any expanded path is currently being ignored by git because git considers it an error if you explicitly specify an ignored path without passing the -f (force) flag to show that you really want to add an ignored path.

If you get git to expand the glob (git add '*') it will add "hidden" files and skip over ignored files. It would work the same as git add . in this case.

这篇关于如果有的话,git add *和git add。有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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