What is the .gitkeep file for?

3

I had the doubt, since I found in a library that I downloaded a file .gitkeep , which was empty. Although I was looking in the GIT documentation I could not find the use of it.

Someone knows if it is used for something or was only created by the author without a specific purpose.

    
asked by Ricardo D. Quiroga 29.05.2017 в 23:14
source

2 answers

3

If you create a new folder in a project under version control with Git, you will see that when doing a git status , it does not appear, while it is empty.

One way to add empty slips to your repository would be to add a file inside it. By convention a .gitkeep is used, that's why it's not an 'official' file of Git, and if you want you can put a file called '.pepito-palotes' (or whatever you like, although the first one is being imposed).

This page explains in detail: link Greetings.

    
answered by 29.05.2017 / 23:22
source
5

The .gitkeep file is just a dummy file to allow an empty folder (except for that file) to be created when cloning the repository, since empty folders are not part of version control.

Actually the file can be called in any way but that is an unofficial convention adopted by some

    
answered by 29.05.2017 в 23:20