Ignore Files and File Types from a Git Repository

In this blog post, I will show you how to configure a git repository to ignore specific files or file types.

If you are using GitHub, for example, you will find that it has a file limit size of 100MB.

That can be an issue if you are using Terraform because it downloads the Windows plugin for Azure which is larger than 100MB.


Git can ignore files and file type using a file called .ignore.

You create the file in the root of your repository.

Inside the file to specify the file names or types.

Create File

I will go ahead and create a .gitignore file, as shown below.

Add file types or specific files

In the file, I will ignore all .exe files.

Success! You're on the list.