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

How to upload some files inside of /storage subdirectory?

在我的 laravel 5.7 应用程序中,我使用带有命令的存储

php artisan storage:link

当我将我的文件上传到 /storage 子目录时,它们没有上传到 git,作为 root。git忽略我的项目 有默认选项:

/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

我尝试修改此文件,如:

/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 上传(我在

中有很多文件
  $ 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

哪种方法正确?

谢谢!

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

如果你想提交 storage/app 中的所有内容,storage/app 中也有一个(不推荐)