What are the differences between .gitignore and .gitkeep? Are they the same thing with a different name, or do they both serve a different function?
I don’t seem to be able to find much documentation on .gitkeep.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
.gitkeepisn’t documented, because it’s not a feature of Git.Git cannot add a completely empty directory. People who want to track empty directories in Git have created the convention of putting files called
.gitkeepin these directories. The file could be called anything; Git assigns no special significance to this name.There is a competing convention of adding a
.gitignorefile to the empty directories to get them tracked, but some people see this as confusing since the goal is to keep the empty directories, not ignore them;.gitignoreis also used to list files that should be ignored by Git when looking for untracked files.