首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何上传/storage子目录中的一些文件?

如何上传/storage子目录中的一些文件?
EN

Stack Overflow用户
提问于 2018-09-24 14:12:42
回答 1查看 679关注 0票数 2

在我的laravel5.7应用程序中,我使用带有命令的存储

代码语言:javascript
复制
php artisan storage:link

当我将文件上载到/storage子目录时,它们不会上传到git,因为我的项目的根.gitignore有默认选项:

代码语言:javascript
复制
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea    $ git add .
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   .gitignore
        new file:   public/storage
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env

我试图修改这个文件如下:

代码语言:javascript
复制
/node_modules
/public/hot
/public/storage/clockwork
/public/storage/debugbar
/public/storage/framework
/public/storage/logs

/storage/clockwork
/storage/debugbar
/storage/framework
/storage/logs

/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env

但是看起来没什么用,因为git上传中没有添加任何文件(我在

代码语言:javascript
复制
  $ git add .
  $ git status
    On branch master
    Your branch is up to date with 'origin/master'.

    Changes to be committed:
      (use "git reset HEAD <file>..." to unstage)

            modified:   .gitignore
            new file:   public/storage/storage/):

    $ git add .
    $ git status
    On branch master
    Your branch is up to date with 'origin/master'.

    Changes to be committed:
      (use "git reset HEAD <file>..." to unstage)

            modified:   .gitignore
            new file:   public/storage

哪条路是对的?

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-09-24 14:24:46

storage/app/public内部将有一个.gitignore文件,需要根据您的喜好进行删除或编辑。

如果您想在storage/app中提交storage/app中的所有内容(并不是真正推荐的),那么在storage/app中也有一个

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52481280

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档