.gitkeep and .gitignore files now these are files that you will see in a lot of git repositories
.gitignore
.gitignore
is one of the files you get as part of git if you use dot .gitignore
that git understands that what you’re saying is here’s a list of files and folders that I don’t want you to track.
- One example would be node modules, which will be a folder, so by putting the slash.
node_modules/ privateFiles.txt
.gitkeep
The .gitkeep
file is just an empty text file called .gitkeep
that we place
inside of folders if we want to make
sure that the folders get put
up onto Github.
-
Empty folders are not seen by git as something that it needs to track. So We use the
.gitkeep
on it. One thing to remember files get tracked; empty folders did not follow. -
If Somebody else downloads the repo, even with empty folders, the naming stays consistent, so if Somebody else downloads the repo, they will get to see these are the name.