简体   繁体   English

Heroku在git push上删除文件?

[英]Heroku deleting files upon git push?

I have a media folder that stores all my uploaded images during development and I'm pushing my django(1.5.1) project to a dev server on heroku. 我有一个媒体文件夹,可以在开发过程中存储我上传的所有图像,并且我将我的django(1.5.1)项目推送到heroku上的开发服务器。 Inside the media folder I have 我有媒体文件夹

media/
    # cache and images were commited before .gitignored was added
    cache/ # store thumbnails
    images/ # store images
    .gitignore

the .gitignore has .gitignore有

*
!.gitignore

The problem is whenever I git push to heroku, all my testing uploads are wiped out by git. 问题是每当我git推送到heroku时,我的所有测试上传都被git消灭了。 Is there a way to deal with this? 有办法解决这个问题吗?

This isn't an issue with Git, but rather with Heroku. 这不是Git的问题,而是Heroku的问题。 Heroku's file system is ephemeral, and is reset between deploys. Heroku的文件系统是短暂的,并在部署之间重置。 Use a service like Amazon S3 to store uploaded files. 使用Amazon S3等服务存储上传的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM