首页 > 解决方案 > Git 在运行 ng build --prod 后没有说什么要提交

问题描述

我在 VSCode 终端中保存了对文件的更改。运行以下命令:

git status(This showed the changes.)
git add .
git status (This showed the files added)
git commit -m "My commit message."
git push (This showed the files were pushed up to git).

然后我运行ng build --prod. 构建运行没有问题。我跑git status了,我得到以下信息:

$git status On branch qa 你的分支是最新的'origin/qa'。

没什么可提交的,工作树干净

我在正确的分支上。我已经重建了很多次,没有问题。任何人都知道如何解决它。

标签: angulargitvisual-studio-code

解决方案


Angular 构建通常保存在根路径中的 dist 文件夹中。

在 .gitignore 文件中,声明了在源代码管理中省略的路径。dist 文件夹就是其中之一。这就是您在git status.

这是 .gitignore 文件内容的示例。

# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist -----> /dist is mentioned in this file
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

推荐阅读