0

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?

GTS Joe
  • 3,612
  • 12
  • 52
  • 94
  • check if #1. .gitignore file is in the root folder of the repository (its not required but recommended) #2. gitignored patterns/paths are correctly specified relative to gitignore file location #3. patterns inside gitignore file are correct. For more clarity, you can add folder structure & .gitignore file in code – Vishal Rajole Sep 10 '20 at 19:02

1 Answers1

1

.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.