Search code examples
githubgithub-actionsgithub-cli

GitHub Not Ignoring .gitignore Directories


I have a Laravel project and when pushing to GitHub, my directories with .gitignore are still pushed to GitHub when I do:

git add .
git commit -m "Sample commit."
git remote add origin git@github.com:My.git
git push origin master

All of the cache and session data in storage/framework/ is pushed to GitHub even though storage/framework/ has .gitignore. All other directories with .gitignore are pushed to GitHub, too.

What am I doing wrong?


Solution

  • .gitignore contains a list of intentionally untracked files to ignore.

    You can check if the patterns given inside .gitignore actually matches with the files/directories that you don't want to commit.