总是使用git add --all

时间:2014-05-01 12:08:22

标签: 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 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.

我该如何避免这种情况?

2 个答案:

答案 0 :(得分:1)

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

类似的东西:

alias ga='git add --all'

答案 1 :(得分:1)

git add -A .或别名@ TimRich的回答。 <{1}}在Git 2.0中含糊不清,这是一个警告。

另请查看How to make Git "add --all" by default?