Thursday, July 19, 2012

Git: Ignore All Contents of a Directory but the Directory Itself

You sometime want to ignore all contents of a directory but the directory itself in a commitment, such as cache/ directory for example. It can both reduce the amount of data and temporary files to be stored in the repository.

In case of Git, all you need is to create a .gitignore file inside the cache/ directory with  the content as follows.

*
!.gitignore

The first line tells Git to ignore all contents, but the second line tells Git to keep the file .gitignore, and therefore, keeps it to be a non-empty directory.

2 comments:

Esteve Julià said...

Thanks!

Anonymous said...

This platform has your back when you have been to bodily casinos and want to play traditional slots. However, the profitable might not be as excessive as many different free slot games. Since they provide bonuses that require slot machines, you’ll by no means see this website run out of them. Slot 바카라사이트 machines are often the most popular games in casinos.