4

I'm using Laravel 5.8, these 2 files often show up on my git status.

enter image description here

Should I add them to .gitignore ?

code-8
  • 54,650
  • 106
  • 352
  • 604

3 Answers3

8

In the folder bootstrap/cache there should already be a .gitignore file containing the following lines:

*
!.gitignore

and it's this file that will fix your issue

N69S
  • 16,110
  • 3
  • 22
  • 36
7

Add this line in your .gitignore file

bootstrap/cache

and then run

git rm -r --cached bootstrap/cache

git rm -r is used to untrack files in a Git branch. This command will remove the file from the staging area and also will remove the file from the repository next time you commit.

Dilip Hirapara
  • 14,810
  • 3
  • 27
  • 49
3

You should always .gitignore cache files, they're never meant to reach the actual production server.

So create a .gitignore file in the bootstrap/cache folder, and put the following two lines:

*
!.gitignore

Remember you might have to remove the files and git push before you can actually ignore them.

Jesper
  • 3,816
  • 2
  • 16
  • 24