[英]aws codecommit repo folder override by git command run on local computer
There was a folder name called profileimg in the local computer and the AWS codecommit repository.在本地计算机和 AWS codecommit 存储库中有一个名为profileimg的文件夹名称。 That folder fills with images when a user uploads images.
当用户上传图像时,该文件夹会填充图像。 However, when I change some code in the local computer repo and git push into remote repo ( AWS codecommit repo ), profileimg folder override with empty data and images are being disappeared.
但是,当我更改本地计算机存储库中的一些代码并将 git 推送到远程存储库(AWS codecommit repo)时,带有空数据和图像的profileimg文件夹覆盖正在消失。 This was a Laravel 8 project hosted in the AWS beanstalk environment.
这是一个托管在 AWS beanstalk 环境中的 Laravel 8 项目。
What I tried so far in the local git repo:到目前为止,我在本地 git 存储库中尝试了什么:
Folder structure:文件夹结构:
.gitignore .gitignore
#exclude everything
public/images/profileimg/*
public/images/profileVerifyDoc/*
#exception
!public/images/profileimg/.gitkeep
!public/images/profileVerifyDoc/.gitkeep
Create an empty file called.gitkeep inside profileimg, then in your.gitignore file write:在 profileimg 中创建一个名为 .gitkeep 的空文件,然后在您的 .gitignore 文件中写入:
# exclude everything
profileimg/*
# exception to the rule
!profileimg/.gitkeep
profileimg folder has created to store user images that are changing over time. profileimg 文件夹已创建用于存储随时间变化的用户图像。 When I added new changes to the code base and git push them to the AWS Beanstalk environment, the existing files and folders getting replace with the new changes.
当我向代码库添加新更改并将 git 推送到 AWS Beanstalk 环境时,现有文件和文件夹将被新更改替换。 The solution is to create an S 3 bucket or save the images in a separate location.
解决方案是创建一个 S 3 存储桶或将图像保存在单独的位置。
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.concepts.design.html https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.concepts.design.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.