【问题标题】:Cloned Laravel project over in an EC2 instance, how should I clean up permissions and git?在 EC2 实例中克隆 Laravel 项目,我应该如何清理权限和 git?
【发布时间】:2014-11-18 08:29:39
【问题描述】:

我终于有一个 laravel 项目配置为在我的 Linux EC2 实例中工作,但我不太了解权限,以及在 Laravel 中应该如何处理权限。我在太多情况下使用 chmod 777 只是为了让它运行,但是有没有人有任何提示为 laravel 设置正确的文件权限?

我还得到了一些未暂存的新 .g​​itignore 文件

On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   deleted:    app/config/database.php
#   modified:   app/config/queue.php
#   modified:   app/storage/.gitignore
#   modified:   app/storage/cache/.gitignore
#   modified:   app/storage/logs/.gitignore
#   modified:   app/storage/meta/.gitignore
#   modified:   app/storage/sessions/.gitignore
#   modified:   app/storage/views/.gitignore
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   .gitignore
#   modified:   app/config/app.php
#   modified:   artisan
#   modified:   public/images/profiles/1300112.jpg
#   modified:   public/images/profiles/1600044.jpg
#   modified:   public/images/profiles/200123.jpg
#   modified:   public/images/profiles/22A00110.jpg
#   modified:   public/images/profiles/23A00003.jpg
#   modified:   public/images/profiles/7A00042.jpg
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   composer.lock

我应该如何清理我的更改?

谢谢

【问题讨论】:

    标签: linux git laravel amazon-ec2 permissions


    【解决方案1】:

    要清除您的更改,请使用以下命令:

    git stash
    git stash drop
    

    文件夹的权限应该是755,文件的权限应该是644。 你可以这样做

    find . -type d -exec chmod 755 {} \;
    find . -type f -exec chmod 644 {} \;
    

    如果你在你的应用目录中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-25
      • 2011-01-12
      • 1970-01-01
      • 1970-01-01
      • 2018-09-11
      • 1970-01-01
      • 2020-02-16
      • 1970-01-01
      相关资源
      最近更新 更多