Ignore Hidden Files When Using Git Add

I recently wanted to push some changes to Github, but I didn’t want to push all of my new files. I created a new folder using the cmd.exe with a ‘.’ in front of the name. All folders in Windows that have a ‘.’ in front of the name are ‘hidden’. Git will still be able to recognize the new folder, so before you add and commit, you can alter a file to say NOT to allow Git to add and commit hidden files/folders.

In the following file:

.git/info/exclude

Add this line after the comments:

.*

Save the file and all your hidden files/folders won’t be added by Git!

Advertisements