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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s