Is it safe to delete the cache folder when pushing a server to Git?

I’m setting up my server to use git instead of filezilla. On my first commit I’ll need to push everything up to github - HUGE file but that isn’t really the problem.

When I want to clone the repository (or download it to other computers), I’ll be downloading the server and the HUGE cache/ directory. Can I safely remove it? Are there parts that I need to keep?

I’m on QBCore and my project structure looks like below:

QBFramework_12345.base/
├── cache/
│   ├── chat/
│   ├── files/
│   ├── screenshot-basic/
│   └── yarn-cache/
├── resources/
│   ├── [qb]
│   └── [scripts]
└── server.cfg
│
└── server.cfg.bkp

The default server-data .gitignore already ignores the cache/ directory. How did you end up without it?

Anyway, to correct that, you can just add that file to your repository.

1 Like

Interesting. I don’t actually have a .gitingnore file. I initialized my repo with git init from the QBFramework_x/ directory.

What default server-data are you talking about? Is this the directory that lives under resources/ called [cfx-default] ?

Or is the default server-data something that lives outside of the QBFramework/ directory? If so, maybe I’ll re-push my project from a couple directories out.

I guess the txAdmin recipe for “QBCore” manually relocates these files, then.

You can still just place the above .gitignore in your repository yourself, however.

1 Like