Iqbal Basyar
Iqbal Basyar

Reputation: 167

How to hide .gitignore file itself

I'm new to git. I can hide several files or folders by adding their names or extensions onto the .gitignore file.

However, other people might see what files/folders I have ignored. I don't know is there a way or setting to make "only you can see the .gitignore file" on Github without making the repository private.

Is there any way to hide .gitignore file from other people but myself (or repo collaborator) ?

Upvotes: 3

Views: 7003

Answers (1)

Simon Doppler
Simon Doppler

Reputation: 2103

You can use the .git/info/exclude file, which is local to your repository (see here).

It uses the same syntax as the .gitignore file.

See also this answer for more information on when/why to use it.

Upvotes: 5

Related Questions