git 暂存除一个文件夹外的所有文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20160503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:23:15  来源:igfitidea点击:

Stage all but one folder

git

提问by Alan Coromano

I have a project containing a few modules. There were some commits previously.

我有一个包含几个模块的项目。之前有一些提交。

How do I stage all the files (modified, deleted, created) and folders in the project butthe one specific folder and all files in it?

我如何暂存项目中的所有文件(修改、删除、创建)和文件夹,一个特定文件夹和其中的所有文件?

回答by Darin Dimitrov

git add .
git reset -- somefolder_to_exclude