Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
始终使用git add--all_Git - Fatal编程技术网

始终使用git add--all

始终使用git add--all,git,Git,有时,当我想git add.时,我会收到这样一条消息,这条消息非常烦人: warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal', whose behaviour will change in Git 2.0 with respect to paths you removed. Paths like 'demos/css/main.css' that are removed from your work

有时,当我想
git add.
时,我会收到这样一条消息,这条消息非常烦人:

warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal',
whose behaviour will change in Git 2.0 with respect to paths you removed.
Paths like 'demos/css/main.css' that are
removed from your working tree are ignored with this version of Git.

* 'git add --ignore-removal <pathspec>', which is the current default,
ignores paths you removed from your working tree.

* 'git add --all <pathspec>' will let you also record the removals.

Run 'git status' to check the paths you removed from your working tree.
警告:运行“git add”时既没有-A(--all)也没有-ignore remove,
在Git2.0中,其行为将因您删除的路径而改变。
类似于“demos/css/main.css”的路径
此版本的Git将忽略从工作树中删除的。
*“git add--ignore remove”是当前默认值,
忽略从工作树中删除的路径。
*“git add--all”还允许您记录删除。
运行“git status”检查从工作树中删除的路径。

如何避免这种情况?

您可以在.bashrc文件中设置别名

比如:

alias ga='git add --all'

git add-A.
或在@TimRich的答案中使用别名<代码>git add.在git 2.0中不明确,这是一个警告


另请查看

谢谢您的投票:)