Committed folders pushed to heroku don't make it

走远了吗. 提交于 2019-12-08 05:29:02

问题


I'm having a weird issue when pushing my app to heroku. It's an angularjs front app with a basic nodejs server to be able to run it on heroku.

I'm pushing a deployment branch with all the app already "compile" by grunt in a /dist folder

My problem is in the /dist/public directory, I have 4 folders : js, css, img and fonts ; but after a push and checking on the dyno with heroku run bash, only the img one is in /dist/public, the 3 others aren't there.

I try to do a new push, renaming the public folder to another name (ie shared) and this time, all 4 folders are there, so it seems heroku's doing something with folders named public but I can't figure why and how to avoid this suppression/ignoring thing.

Has any of you encountered the same issue, and how to resolve it without having to rename my public folder ?

EDIT :

Adding my .gitignore file for those of you wondering about that:

/.vagrant/machines
/node_modules
/app/bower_components
/.sass-cache
/test
/app/src/lib/config.js
/dist

回答1:


Do a git add -f dist/public/js dist/public/css dist/public/fonts from within your repo.

You have a .gitignore rule for /dist, which will ignore any files within /dist and its subdirectories, unless they are already being tracked. My guess is, that the files you have newly generated were not being tracked earlier, and hence they were silently ignored.

The -f flag in the git add above will add those forcefully (overriding the ignore rule), and so you will be able to make commits.

If there are only a few files, and you want to avoid adding the whole folders, I would suggest adding each of the individual files forcefully (i.e., with the -f flag).



来源:https://stackoverflow.com/questions/25456288/committed-folders-pushed-to-heroku-dont-make-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!