Allow the .gitignore file to upload a folder with the files it has inside

1

The routes are /storage/app/public/employees and /storage/app/public/projects , en /storage/app/public I have the file .gitignore.

How can I do to ignore everything except those two folders?

    
asked by Lluís Puig Ferrer 23.10.2017 в 17:09
source

1 answer

3

To omit everything except those specific files, you can use the ! symbol:

# Ignorar todo
*

# Pero incluir
!employees/*
!projects/*

Documentación

  

An optional prefix "! " which negates the pattern; any matching file   excluded by a previous pattern will become included again.

     

An optional prefix "! " that denies the pattern. Any file   coincident previously excluded by another pattern will again be   included again.

    
answered by 23.10.2017 в 17:15