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状态关于分支qa您的分支机构是最新的"origin/qa"。

无需提交,工作树清理

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

角度构建通常保存在根路径中的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

您的/dist目录位于项目根目录的.gitignore文件中,如果您需要将编译后的版本上传到git(可以做到,但这不是一个好的做法(,您应该从.gitigner文件中删除此目录,并再次运行git status来检查

相关内容

最新更新