混帐:只有舞台新文件 [英] git: stage only new files
本文介绍了混帐:只有舞台新文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我有:
- 肮脏的工作目录
- 肮脏的暂存区域,
- ,我复制了一些新的文件到项目中,
我怎么只上演了新的?
git的别名adduntracked = ...
解决方案
这个别名会尊重你的忽略模式(内置,全局和每个目录,由帮助描述的git-LS-文件--exclude标准
)。它会在你的树的顶层运行。
[别名]
adduntracked =!混帐加$(GIT LS-文件-o --exclude标)
When I have:
- dirty working directory,
- dirty staging area,
- and I copied some new files to the project,
how do I stage only the new ones?
git alias adduntracked=…
解决方案
This alias will respect your ignore patterns (builtin, global and per-directory, as described by the help for git-ls-files --exclude-standard
). It will run at the top level of your tree.
[alias]
adduntracked=!git add $(git ls-files -o --exclude-standard)
这篇关于混帐:只有舞台新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文