Skip to content

How do I make a folder? #21705

Discussion options

You must be logged in to vote

git doesn’t have a concept of “folders” by itself. Git tracks files and if a file happens to have a name like foo/bar/baz.txt, then when git recreates the repository locally it creates the foo folder, the foo/bar folder, and then the baz.txt file within the foo/bar folder.

So if you want to create a folder within a repository, you have to create a file within it. One common way people do this is to create an empty file named .gitkeep in the directory that they want to exist.

To create a folder this way through the GitHub web interface, you would follow the instructions for creating files. When it comes time to name the file, you would enter foo/bar/.gitkeep. You’ll notice that each time y…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants