在本地计算机上运行的git命令覆盖aws codecommit repo文件夹 [英] aws codecommit repo folder override by git command run on local computer

查看:114
本文介绍了在本地计算机上运行的git命令覆盖aws codecommit repo文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本地计算机和AWS Codecommit存储库中有一个名为 profileimg 的文件夹名称.用户上载图像时,该文件夹将充满图像.但是,当我更改本地计算机存储库中的某些代码并将git push到远程存储库(AWS codecommit repo)中时,带有空数据的 profileimg 文件夹替代会消失,并且图像会消失.这是一个在AWS beantalk环境中托管的Laravel 8项目.

There was a folder name called profileimg in the local computer and the AWS codecommit repository. 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. This was a Laravel 8 project hosted in the AWS beanstalk environment.

到目前为止,我在本地git存储库中尝试过的操作:

What I tried so far in the local git repo:

  • $ git rm -r-缓存的public/images/profileimg/*
  • $ git update-index-假定未更改的public/images/profileimg/*

文件夹结构:

  • 公共
    • 图片
      • profileimg

      .gitignore

      #exclude everything
      public/images/profileimg/*
      public/images/profileVerifyDoc/*
      
      #exception
      !public/images/profileimg/.gitkeep
      !public/images/profileVerifyDoc/.gitkeep
      

      推荐答案

      profileimg文件夹已创建,用于存储随时间变化的用户图像.当我向代码库添加新更改并将其推送到AWS Beanstalk环境时,git将现有文件和文件夹替换为新更改.解决方案是创建一个S 3存储桶或将图像保存在单独的位置.

      profileimg folder has created to store user images that are changing over time. 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. The solution is to create an S 3 bucket or save the images in a separate location.

      https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.concepts.design.html

      这篇关于在本地计算机上运行的git命令覆盖aws codecommit repo文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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