How to ignore folder tracking with GIT

A frequently asked question on GIT is how to ignore a folder tracking. We can have in our project folders which contains cache files, file uploads, etc and are unnecesary to be included in our GIT repository.

To do this, we need to create a .gitignore file on our GIT root folder.

Then, if we want to disable a folder for tracking, we add the next line on the file:


Save the .gitignore file.

Now all files and subfolders from this directory will be ignored by GIT.