mwave317
mwave317

Reputation: 19

Git says nothing to commit after running ng build --prod

I saved the changes to my files in the VSCode terminal. Ran the following commands:

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).

Then I run the ng build --prod. The build runs without a problem. I run git status and I get the following:

$git status On branch qa Your branch is up to date with 'origin/qa'.

nothing to commit, working tree clean

I'm on the correct branch. I've rebuilt this a number of times without a problem. Anyone have any idea how to fix it.

Upvotes: 0

Views: 622

Answers (2)

Yuva Raj
Yuva Raj

Reputation: 3881

Angular builds are usually saved in dist folder which is in root path.

In .gitignore file, paths are declared which omits in source control. dist folder is one among them. That is the reason you are unable to see the files during git status.

Here is the sample of .gitignore file contents.

# 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

Upvotes: 2

Diego Martinez
Diego Martinez

Reputation: 1

your / dist directory is in the .gitignore file at the root of the project, if you need to upload the compiled version to git (it can be done, but it is not a good practice), you should remove this directory from the .gitignore file, and run git status again to check

Upvotes: 0

Related Questions