Hidden file contents

Hello everyone. I was wondering if it was possible to make a file or a folder (mostly a folder) visible on GitHub, but have that file’s contents hidden. Something like when submodules are grey-ed out. 

Please excuse my bad english and you should now that I’m new to GitHub.

Thanks in advance

Hi @alexejheroytb,

Welcome to the community forums. :slight_smile:

When you say hidden, do you mean greyed out in the file viewer on GitHub.com? If so, there isn’t a way to do that right now, but if instead you simply don’t want a specific file or folder contents to be uploaded to GitHub in the first place, you’ll want to add that file or folder to your .gitignore file

Here are instructions on how to do that: https://help.github.com/articles/ignoring-files/

​If there’s anything else I can help you with, let me know; so happy to help further!

Kindest regards,


I understand. I wanted to have them grey-ed out so that someone who looks in my repo knows that the folder is there, but they can’t see what’s inside

Hi @alexejheroytb

One of the reasons for this is that if a user can see a repository, they can download or clone that repository as well. Even if a file was hidden in the file viewer, it would be accessible in the downloaded file.



I understand. Thank you!

1 Like