.gitignore not ignoring folder .gitignore not ignoring folder laravel laravel

.gitignore not ignoring folder


In .gitignore add

public/forum

Run

git rm --cached -r public/forum


The problem is that this folder is already in your index (you committed it at an earlier moment). Changes to files in the index will always be in "git status". Only new files in that folder will be ignored.

To fix it. See my answer on https://stackoverflow.com/a/38304114/2274140


Do the following to trigger the gitignore:

  1. Commit all your pending changes in the repository which you want to fix and push that.

  2. Remove everything from the git index in order to refresh your git repository. This is safe. Use this command:

    git rm -r --cached .
  3. Add everything back into the repo, which can be done using this command:

    git add .
  4. Commit these changes, using this command:

    git commit -m "Gitignore issue fixed"