被推送到heroku的提交文件夹不会 [英] Committed folders pushed to heroku don't make it

查看:157
本文介绍了被推送到heroku的提交文件夹不会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的应用推向heroku时,我遇到了一个奇怪的问题。
这是一个 angularjs 前端应用程序,它有一个基本的nodejs服务器可以在heroku上运行它。



我正在推送一个部署分支,其中所有应用程序已经在 / dist 文件夹中通过grunt编译。



我的问题是在 / dist / public 目录中,我有4个文件夹: js css img 字体;但是在用 heroku run bash 检查dyno后,只有 img 一个在 / dist / public ,其他3个不存在。



我试着做一个新的推文,重命名 public 文件夹转换为另一个名称(即 shared ),这一次,所有4个文件夹都在那里,所以看起来好像heroku在做文件夹命名为 public ,但我不知道为什么以及如何避免这种压制/忽略的事情。



有没有人遇到同样的问题,以及如何解决它,而不必重新命名我的公共文件夹?



编辑:



 <$ c $>为我们添加我的 .gitignore 文件c> /。vagrant / machines 
/ node_modules
/ app / bower_components
/.sass-cache
/ test
/app/src/lib/config.js
/ dist


解决方案

$ c> git add -f dist / b / b

你有一个 / public / js dist / public / css dist / public / fonts .gitignore 规则适用于 / dist ,它将忽略 / dist 内的任何文件及其子目录,除非它们已经被跟踪。我的猜测是,你新创建的文件没有被跟踪,因此他们被默默地忽略了。



-f flag在上面的git add会强制地添加这些(覆盖忽略规则),所以你可以进行提交。



如果有只有几个文件,并且您希望避免添加整个文件夹,我会建议强制添加每个单独的文件(即使用 -f 标志)。 p>

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

解决方案

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

这篇关于被推送到heroku的提交文件夹不会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆